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

# Issue project API key

> Issues the API key of a project. **This** key, not the partner key, is what the customer's traffic uses on `/v1/messages`, `/v1/templates` and the other routes. The partner key never sends messages.

The `secret` is shown **only once**, in the response. Store it safely.

Requires the `api_keys:write` scope, which a new partner key does **not** have. A leaked partner key with this scope can issue keys that send messages for any of your customers. Restrict it to the addresses of your servers and set an expiry.

Ask for the smallest set of scopes that works. The scopes of a project key are listed in [Authentication](/en/authentication). Unknown values are ignored, and `scopes: []` creates a key that cannot do anything.



## OpenAPI

````yaml en/openapi.json POST /v1/partner/projects/{projectId}/api_keys
openapi: 3.0.3
info:
  title: Routa API
  description: >-
    REST API to send and receive WhatsApp messages, track delivery and receive
    normalized events through webhooks.
  version: '1'
servers:
  - url: https://api.routa.chat
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Messages
    description: Send, retrieve and list messages.
  - name: Events
    description: Query the log of normalized events.
  - name: Webhooks
    description: Manage webhook endpoints, secrets and deliveries.
  - name: Templates
    description: Create and retrieve WhatsApp templates.
  - name: Media
    description: Upload and download media files.
  - name: Usage
    description: Query the metered usage of the project.
  - name: Identity
    description: Identify the API key in use.
  - name: Partners
    description: >-
      Create one project per customer, issue the key of each project, follow the
      channels and receive the events of every customer on a single webhook.
      These routes use a partner key (`rt_partner_...`). See [Partner
      API](/en/partners/overview).
paths:
  /v1/partner/projects/{projectId}/api_keys:
    post:
      tags:
        - Partners
      summary: Issue project API key
      description: >-
        Issues the API key of a project. **This** key, not the partner key, is
        what the customer's traffic uses on `/v1/messages`, `/v1/templates` and
        the other routes. The partner key never sends messages.


        The `secret` is shown **only once**, in the response. Store it safely.


        Requires the `api_keys:write` scope, which a new partner key does
        **not** have. A leaked partner key with this scope can issue keys that
        send messages for any of your customers. Restrict it to the addresses of
        your servers and set an expiry.


        Ask for the smallest set of scopes that works. The scopes of a project
        key are listed in [Authentication](/en/authentication). Unknown values
        are ignored, and `scopes: []` creates a key that cannot do anything.
      operationId: createPartnerProjectApiKey
      parameters:
        - schema:
            type: string
          in: path
          name: projectId
          required: true
          description: >-
            Project ID (`proj_...`). Only a project created through the Partner
            API is accepted.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - scopes
              properties:
                name:
                  description: >-
                    What you call this key, for example `Backend of customer
                    123`. At most 80 characters, after trimming the surrounding
                    spaces.
                  type: string
                  example: Acme Store
                scopes:
                  description: Scopes of the project key. Ask only for the ones you need.
                  type: array
                  items:
                    type: string
                  example:
                    - messages:write
                    - messages:read
                expires_at:
                  format: date-time
                  type: string
                  description: >-
                    When the key expires, in ISO 8601. Without this field, the
                    key does not expire.
                ip_allowlist:
                  type: array
                  items:
                    type: string
                  description: >-
                    IPv4 addresses or IPv4 CIDR blocks allowed to use the key.
                    IPv6 addresses are compared as exact text. An empty list
                    applies no restriction.
            example:
              name: Acme Store
              scopes:
                - messages:write
                - messages:read
      responses:
        '201':
          description: Key created. The `secret` is shown only once
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerProjectApiKeyWithSecret'
        '401':
          description: >-
            The partner key is missing, invalid, revoked, expired or used from
            outside its IP allowlist (`partner_key_invalid`). A project key also
            gets this error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The partner key lacks the required scope (`insufficient_scope`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            The resource does not exist, does not belong to your organization or
            was not created through the Partner API. Also returns
            `partner_api_not_available` when your plan does not include the
            Partner API
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Invalid request (`request_invalid`, `invalid_api_key_name`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limit exceeded: 10 requests per second, with bursts of up to
            30, per organization. See the `Retry-After` header
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - partnerAuth:
            - api_keys:write
components:
  schemas:
    PartnerProjectApiKeyWithSecret:
      type: object
      properties:
        id:
          type: string
          description: Key ID.
          example: key_01J8ZK9M3Q7XABCDEFGHJKMNPQ
        project_id:
          type: string
          description: Project the key belongs to.
          example: proj_01J8ZK9M3Q7XABCDEFGHJKMNPQ
        name:
          type: string
          nullable: true
          description: The name you gave the key, or `null`.
          example: Acme Store
        key_prefix:
          type: string
          description: First characters of the key, safe to display.
          example: rt_live_abc
        last_four:
          type: string
          description: Last four characters of the key.
          example: k3xQ
        scopes:
          type: array
          items:
            type: string
            enum:
              - messages:read
              - messages:write
              - channels:read
              - channels:write
              - events:read
              - webhooks:write
              - usage:read
              - templates:read
              - templates:write
              - media:read
              - media:write
          description: Scopes granted to the project key.
        expires_at:
          format: date-time
          type: string
          nullable: true
          description: When the key expires, or `null` if it does not.
        ip_allowlist:
          type: array
          items:
            type: string
          description: >-
            Allowed IP addresses or CIDR blocks. An empty list applies no
            restriction.
        created_at:
          format: date-time
          type: string
          description: When the key was created.
          example: '2026-09-04T13:22:41.031Z'
        revoked_at:
          format: date-time
          type: string
          nullable: true
          description: When the key was revoked, or `null` while it is active.
        last_used_at:
          format: date-time
          type: string
          nullable: true
          description: Last use of the key, rounded to the minute, or `null`.
        secret:
          type: string
          description: The full API key. Shown **only now**. Store it safely.
          example: rt_live_...
      required:
        - id
        - project_id
        - name
        - key_prefix
        - last_four
        - scopes
        - expires_at
        - ip_allowlist
        - created_at
        - revoked_at
        - last_used_at
        - secret
    Error:
      type: object
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          properties:
            type:
              type: string
              description: >-
                Error category: `invalid_request_error`, `authentication_error`,
                `permission_error`, `not_found_error`, `conflict_error`,
                `rate_limit_error`, `billing_error` or `api_error`.
              example: invalid_request_error
            code:
              type: string
              description: >-
                Stable, machine-readable code. See [Error
                codes](/en/errors/error-codes).
              example: channel_inactive
            message:
              type: string
              description: >-
                Human-readable text, in English. It can change, so do not parse
                it.
              example: Channel chan_01J8... is not active and cannot send messages.
            param:
              type: string
              description: >-
                The request field at fault, when it applies. It is filled in on
                `request_invalid` (the field outside the schema, such as
                `template.button_parameters.0.index`) and on template errors:
                `name` in `template_name_invalid`; `body_text`,
                `components.header`, `components.footer` or `components.buttons`
                in `template_components_invalid`; and `variable_examples`,
                `variable_examples.<position>`, `components.header.example` or
                `components.buttons.<position>.example` when
                `template_variables_invalid` refuses an example.
              example: components.buttons.0.example
            doc_url:
              type: string
              description: Link to the documentation of the code, when available.
            details:
              type: object
              additionalProperties:
                oneOf:
                  - type: string
                  - type: number
              description: >-
                Actionable values, such as `limit`, `used` and `resets_at` in
                `message_quota_exceeded`, or `reason`, which tells apart the
                causes behind one code, in errors such as `invalid_recipient`
                and `template_variables_invalid`. See [Actionable
                details](/en/errors/overview#actionable-details).
            request_id:
              type: string
              description: Request ID. Quote it when you contact support.
              example: req_01J8ZK9M3Q7XABCDEFGHJKMNPQ
          description: Error details.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Project API key, in the format `rt_live_...` or `rt_test_...`, sent as
        `Authorization: Bearer <key>`.
    partnerAuth:
      type: http
      scheme: bearer
      description: >-
        Partner key, in the format `rt_partner_...`, sent as `Authorization:
        Bearer <key>`. It only works on the `/v1/partner/*` routes. A project
        key does not work on them, and a partner key does not work on any other
        route.

````

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