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

# Create a persona



## OpenAPI

````yaml /api-reference/openapi.yaml post /personas
openapi: 3.1.0
info:
  title: Avina API
  version: 1.0.0-draft
  description: >
    The Avina developer API, for calling Avina from your own servers.


    **Authentication.** Send your workspace API key: `Authorization: Bearer
    <key>`. Create keys in

    the Avina dashboard under Settings → API keys.


    **Credits.** `GET /usage` reports your workspace's signal credits for the
    current billing

    period: the same credits and period the dashboard shows.


    **Conventions.** JSON with snake_case fields and UTC ISO-8601 timestamps.
    Paginated lists use

    `limit` + `after` cursor pagination. `POST` requests accept an
    `Idempotency-Key` header

    (kept 24 hours). Every response has `X-Request-Id`. Request bodies must be
    JSON

    (`415 invalid_request` otherwise) and are limited to 100 KB (`413
    invalid_request`). A

    `503 internal_error` means the API key could not be checked; retry the
    request.
servers:
  - url: https://api.avina.io/v1
    description: Production (proposed domain)
security:
  - apiKey: []
tags:
  - name: Account
  - name: Personas
paths:
  /personas:
    post:
      tags:
        - Personas
      summary: Create a persona
      operationId: createPersona
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PersonaCreate'
            example:
              name: Sales leaders
              job_titles:
                - VP Sales
                - CRO
                - Head of Sales
              contacts_per_company: 2
              enrich_emails: true
              enrich_phones: false
              contact_countries:
                - US
                - CA
      responses:
        '201':
          description: The created persona.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Persona'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Any unique string. Retrying with the same key returns the first response
        instead of repeating the action.
      schema:
        type: string
        maxLength: 255
  schemas:
    PersonaCreate:
      type: object
      additionalProperties: false
      required:
        - job_titles
      properties:
        name:
          type:
            - string
            - 'null'
          maxLength: 191
        job_titles:
          type: array
          items:
            type: string
          minItems: 1
        contacts_per_company:
          type: integer
          minimum: 1
          maximum: 100
          default: 1
        enrich_emails:
          type: boolean
          default: true
        enrich_phones:
          type: boolean
          default: false
          description: Phone enrichment costs extra credits.
        contact_countries:
          type:
            - array
            - 'null'
          items:
            type: string
            pattern: ^[A-Za-z]{2}$
          description: >-
            Countries where the contacts are located (ISO 3166-1 alpha-2), not
            the company headquarters. null or [] = worldwide.
          example:
            - US
            - CA
    Persona:
      type: object
      required:
        - object
        - id
        - job_titles
        - contacts_per_company
        - enrich_emails
        - enrich_phones
        - contact_countries
        - created_at
        - updated_at
      properties:
        object:
          type: string
          const: persona
        id:
          type: string
          format: uuid
        name:
          type:
            - string
            - 'null'
        job_titles:
          type: array
          items:
            type: string
        contacts_per_company:
          type: integer
        enrich_emails:
          type: boolean
        enrich_phones:
          type: boolean
        contact_countries:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            Countries where the contacts are located, uppercase; null or [] =
            worldwide.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              enum:
                - invalid_request
                - invalid_api_key
                - not_found
                - idempotency_key_reused
                - rate_limited
                - internal_error
                - timeout
            message:
              type: string
            request_id:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
  responses:
    BadRequest:
      description: The request is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request
              message: foo is not a recognized field
              request_id: req_8f2a
              details:
                - field: foo
                  message: is not a recognized field
    Unauthorized:
      description: The API key is missing, invalid or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_api_key
              message: The API key is invalid or revoked.
              request_id: req_8f2a
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Workspace API key from the Avina dashboard (Settings → API keys).

````

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