> For the complete documentation index, see [llms.txt](https://developers.myscreators.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.myscreators.com/referencia-de-la-api/clientes.md).

# Clientes

Crear, consultar, eliminar y buscar clientes.

Operaciones para gestionar los clientes del CRM.

## Crear cliente

> Crea un cliente nuevo. Respuesta típica: \`Client add successful.\`

```json
{"openapi":"3.0.3","info":{"title":"M&S Creators — CRM API","version":"1.1.2"},"tags":[{"name":"Clientes","description":"Gestión de clientes: crear, consultar, eliminar y buscar."}],"servers":[{"url":"https://crm.myscreators.com/index.php/api","description":"Producción"}],"security":[{"ApiToken":[]}],"components":{"securitySchemes":{"ApiToken":{"type":"apiKey","in":"header","name":"authtoken","description":"Token de instalación de M&S. Envíalo en el encabezado `authtoken` de cada solicitud."}},"schemas":{"ClientCreate":{"type":"object","description":"Datos para crear un cliente. Solo `company_name` es obligatorio.","required":["company_name"],"properties":{"company_name":{"type":"string","description":"Nombre de la empresa."},"address":{"type":"string"},"phone":{"type":"string"},"website":{"type":"string"}}},"ApiMessage":{"type":"object","description":"Respuesta genérica de estado para operaciones de escritura y borrado.","properties":{"status":{"type":"boolean","description":"`true` si la operación fue exitosa."},"message":{"type":"string","description":"Mensaje legible del resultado."}}}},"responses":{"Unauthorized":{"description":"Token ausente o inválido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiMessage"}}}}}},"paths":{"/clients":{"post":{"tags":["Clientes"],"operationId":"createClient","summary":"Crear cliente","description":"Crea un cliente nuevo. Respuesta típica: `Client add successful.`","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/ClientCreate"}}}},"responses":{"200":{"description":"Cliente creado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiMessage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## GET /clients/{id}

> Obtener cliente por ID

```json
{"openapi":"3.0.3","info":{"title":"M&S Creators — CRM API","version":"1.1.2"},"tags":[{"name":"Clientes","description":"Gestión de clientes: crear, consultar, eliminar y buscar."}],"servers":[{"url":"https://crm.myscreators.com/index.php/api","description":"Producción"}],"security":[{"ApiToken":[]}],"components":{"securitySchemes":{"ApiToken":{"type":"apiKey","in":"header","name":"authtoken","description":"Token de instalación de M&S. Envíalo en el encabezado `authtoken` de cada solicitud."}},"schemas":{"Client":{"type":"object","description":"Cliente registrado en el CRM.","properties":{"id":{"type":"integer"},"company_name":{"type":"string"},"address":{"type":"string"},"created_date":{"type":"string","format":"date"},"is_lead":{"type":"string"},"lead_status_id":{"type":"string"},"owner_id":{"type":"string"},"primary_contact":{"type":"string"},"total_projects":{"type":"string"}}},"ApiMessage":{"type":"object","description":"Respuesta genérica de estado para operaciones de escritura y borrado.","properties":{"status":{"type":"boolean","description":"`true` si la operación fue exitosa."},"message":{"type":"string","description":"Mensaje legible del resultado."}}}},"responses":{"Unauthorized":{"description":"Token ausente o inválido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiMessage"}}}},"NotFound":{"description":"Recurso no encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiMessage"}}}}}},"paths":{"/clients/{id}":{"get":{"tags":["Clientes"],"operationId":"getClient","summary":"Obtener cliente por ID","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"},"description":"Identificador del recurso."}],"responses":{"200":{"description":"Cliente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Client"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
```

## DELETE /clients/{id}

> Eliminar cliente

```json
{"openapi":"3.0.3","info":{"title":"M&S Creators — CRM API","version":"1.1.2"},"tags":[{"name":"Clientes","description":"Gestión de clientes: crear, consultar, eliminar y buscar."}],"servers":[{"url":"https://crm.myscreators.com/index.php/api","description":"Producción"}],"security":[{"ApiToken":[]}],"components":{"securitySchemes":{"ApiToken":{"type":"apiKey","in":"header","name":"authtoken","description":"Token de instalación de M&S. Envíalo en el encabezado `authtoken` de cada solicitud."}},"schemas":{"ApiMessage":{"type":"object","description":"Respuesta genérica de estado para operaciones de escritura y borrado.","properties":{"status":{"type":"boolean","description":"`true` si la operación fue exitosa."},"message":{"type":"string","description":"Mensaje legible del resultado."}}}},"responses":{"Unauthorized":{"description":"Token ausente o inválido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiMessage"}}}},"NotFound":{"description":"Recurso no encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiMessage"}}}}}},"paths":{"/clients/{id}":{"delete":{"tags":["Clientes"],"operationId":"deleteClient","summary":"Eliminar cliente","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"},"description":"Identificador del recurso."}],"responses":{"200":{"description":"Cliente eliminado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiMessage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
```

## GET /getClientsSearch/search/{keysearch}

> Buscar clientes

```json
{"openapi":"3.0.3","info":{"title":"M&S Creators — CRM API","version":"1.1.2"},"tags":[{"name":"Clientes","description":"Gestión de clientes: crear, consultar, eliminar y buscar."}],"servers":[{"url":"https://crm.myscreators.com/index.php/api","description":"Producción"}],"security":[{"ApiToken":[]}],"components":{"securitySchemes":{"ApiToken":{"type":"apiKey","in":"header","name":"authtoken","description":"Token de instalación de M&S. Envíalo en el encabezado `authtoken` de cada solicitud."}},"schemas":{"ClientSearchItem":{"type":"object","description":"Coincidencia de cliente en una búsqueda.","properties":{"id":{"type":"integer"},"company_name":{"type":"string"},"invoice_value":{"type":"string"},"client_groups":{"type":"string"}}},"ApiMessage":{"type":"object","description":"Respuesta genérica de estado para operaciones de escritura y borrado.","properties":{"status":{"type":"boolean","description":"`true` si la operación fue exitosa."},"message":{"type":"string","description":"Mensaje legible del resultado."}}}},"responses":{"Unauthorized":{"description":"Token ausente o inválido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiMessage"}}}}}},"paths":{"/getClientsSearch/search/{keysearch}":{"get":{"tags":["Clientes"],"operationId":"searchClients","summary":"Buscar clientes","parameters":[{"in":"path","name":"keysearch","required":true,"schema":{"type":"string"},"description":"Texto a buscar."}],"responses":{"200":{"description":"Coincidencias de clientes.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClientSearchItem"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.myscreators.com/referencia-de-la-api/clientes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
