> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jelou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Services per subcompany

> Subcompanies of the partner with their plan, active channels and published workflows

Returns a page of the partner's active subcompanies with what they have contracted and published.

## Subcompany fields

| Field | Type | Description |
| - | - | - |
| `id` | string | Jelou company id. |
| `externalId` | string \| null | Identifier of the company in your systems, when set. |
| `name` | string | Company name. |
| `plan` | string \| null | Company plan, for example `SMB` or `SELF_SERVICE`. |
| `activeChannels` | string\[] | Channel types with at least one active channel, lowercase and sorted. |
| `publishedWorkflows` | integer | Workflows published to production. |

> [!NOTE]
>
> Subcompanies are sorted by `id`. Walk the pages with `page` until you cover `total`.

```bash cURL theme={null}
curl --request GET \
  --url 'https://gateway.jelou.ai/v1/partner/services?page=1&limit=25' \
  --header 'x-api-key: <API_KEY>'
```

```json 200 Success theme={null}
{
  "success": true,
  "result": {
    "partner": "acme",
    "page": 1,
    "limit": 25,
    "total": 2,
    "subcompanies": [
      {
        "id": "1024",
        "externalId": "C-000123",
        "name": "Acme Retail",
        "plan": "SMB",
        "activeChannels": ["whatsapp", "widget"],
        "publishedWorkflows": 3
      },
      {
        "id": "1031",
        "externalId": null,
        "name": "Acme Seguros",
        "plan": "SELF_SERVICE",
        "activeChannels": ["whatsapp"],
        "publishedWorkflows": 1
      }
    ]
  },
  "statusCode": 200
}
```

```json 403 Missing partners:read theme={null}
{
  "success": false,
  "statusCode": 403
}
```


## OpenAPI

````yaml api/partner/openapi.json GET /services
openapi: 3.1.0
info:
  title: Jelou Partner API
  version: 1.0.0
  description: >-
    Read-only API for partners to monitor the companies subscribed to their
    products. The partner is resolved from the API key, so no route takes a
    partner identifier.
servers:
  - url: https://gateway.jelou.ai/v1/partner
    description: Production
security:
  - apiKey: []
paths:
  /services:
    get:
      summary: List subcompanies and their services
      description: >-
        Active companies subscribed to the partner, with their plan, active
        channel types and published workflows.
      operationId: listPartnerServices
      parameters:
        - name: page
          in: query
          description: Page number.
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: limit
          in: query
          description: Subcompanies per page.
          schema:
            type: integer
            minimum: 1
            maximum: 25
            default: 25
      responses:
        '200':
          description: A page of subcompanies.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - result
                  - statusCode
                properties:
                  success:
                    const: true
                  statusCode:
                    const: 200
                  result:
                    type: object
                    required:
                      - partner
                      - page
                      - limit
                      - total
                      - subcompanies
                    properties:
                      partner:
                        type: string
                        description: Partner slug resolved from the API key.
                      page:
                        type: integer
                      limit:
                        type: integer
                      total:
                        type: integer
                        description: Subcompanies matching the request across all pages.
                      subcompanies:
                        type: array
                        items:
                          $ref: '#/components/schemas/ServiceSubcompany'
        '400':
          description: Invalid query parameter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - statusCode
                  - error
                properties:
                  success:
                    const: false
                  statusCode:
                    const: 400
                  error:
                    type: string
                    enum:
                      - invalid_page
                      - invalid_limit
        '401':
          description: Missing or invalid API key.
        '403':
          description: >-
            The API key lacks the `partners:read` scope, carries the `*`
            wildcard, or does not belong to an active partner.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - statusCode
                properties:
                  success:
                    const: false
                  statusCode:
                    const: 403
        '404':
          description: >-
            Resource not found. Also returned for a company that is not a
            subscriber of the partner.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - statusCode
                properties:
                  success:
                    const: false
                  statusCode:
                    const: 404
        '429':
          description: 'Rate limit exceeded: 60 requests per minute.'
        '500':
          description: Unexpected error.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - statusCode
                properties:
                  success:
                    const: false
                  statusCode:
                    const: 500
components:
  schemas:
    ServiceSubcompany:
      type: object
      required:
        - id
        - externalId
        - name
        - plan
        - activeChannels
        - publishedWorkflows
      properties:
        id:
          type: string
          description: Jelou company id.
        externalId:
          type:
            - string
            - 'null'
          description: Identifier of the company in the partner's own systems, when set.
        name:
          type: string
        plan:
          type:
            - string
            - 'null'
        activeChannels:
          type: array
          items:
            type: string
          description: Distinct types of the active channels, lowercase and sorted.
        publishedWorkflows:
          type: integer
          description: Workflows published to production.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Organization API key with the `partners:read` scope.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.