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

# Create

> Create an agency.



## OpenAPI

````yaml POST /agencies
openapi: 3.0.3
info:
  title: OnlyTraffic Studio API
  version: 1.0.0
  description: >-
    External API for OnlyTraffic Studio. Manage and retrieve data about your
    subscribers, CPL orders, and CPC orders.
servers:
  - url: https://studio-api.onlytraffic.com/api/external/v1
security:
  - ApiKeyAuth: []
tags:
  - name: Account
    description: API key holder's wallet, profile, and aggregate state.
  - name: Accounts
    description: OnlyFans accounts attached to the API key holder.
  - name: Agencies
    description: Agency CRUD and image management. All edits stage in moderation.
  - name: CPL
    description: >-
      Cost-per-lead orders: place, list, cancel, manage settings, browse partner
      offers.
  - name: CPC
    description: Cost-per-click orders and creative management.
  - name: RevShare
    description: Revenue-share campaigns and invoices.
  - name: Swaps
    description: Two-sided traffic swap orders and offers.
  - name: Subscribers
    description: Per-fan delivery feed (cursor-paginated).
  - name: Transactions
    description: Per-transaction OF revenue feed (cursor-paginated).
paths:
  /agencies:
    post:
      tags:
        - Agencies
      summary: Create
      description: Create an agency.
      operationId: createAgency
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgencyCreateRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      uuid:
                        type: string
                        format: uuid
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error or limit reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AgencyCreateRequest:
      description: >-
        Body for `POST /agencies`. `name`, `slug`, and `code` are required and
        become immutable after creation.
      allOf:
        - $ref: '#/components/schemas/AgencyWriteable'
        - required:
            - name
            - slug
            - code
    ErrorResponse:
      type: object
      description: Standard error envelope for all 4xx/5xx responses.
      required:
        - success
        - error
        - message
      properties:
        success:
          type: boolean
          enum:
            - false
          description: Always false on error responses.
        error:
          type: string
          description: Stable snake_case machine-readable error code. Branch on this.
          example: validation_failed
        message:
          type: string
          description: >-
            Human-friendly text. For 5xx this is always the literal `Server
            error`. For 4xx an actionable validation/auth message is returned.
        details:
          type: object
          nullable: true
          description: >-
            Optional per-field diagnostic information. On 422 carries `{<field>:
            ["error_code", ...]}`. On 402 (`insufficient_balance`) carries
            `{required, current}`. On 426 (`unpaid_invoices`) carries `{count,
            total, oldest_date_ts}`. Absent on most other errors.
          additionalProperties: true
        retry_after:
          type: integer
          nullable: true
          description: >-
            Seconds until the next request will succeed. Present only on 429
            responses (rate limit). Mirrors the `Retry-After` HTTP header.
    AgencyWriteable:
      type: object
      description: >-
        Editable fields for create/update. Image fields (avatar/header) live on
        dedicated upload endpoints (`POST /agencies/{uuid}/avatar`, `POST
        /agencies/{uuid}/header`).
      properties:
        name:
          type: string
          minLength: 2
          maxLength: 55
          description: >-
            Required on create. Immutable afterwards: passed `name` is silently
            ignored on update.
          example: Bright Studio
        slug:
          type: string
          pattern: ^[a-z0-9-]+$
          minLength: 3
          maxLength: 35
          description: >-
            URL-friendly identifier, lowercase letters / digits / hyphens.
            Required on create, immutable afterwards (silently ignored on
            update).
          example: bright-studio
        code:
          type: string
          pattern: ^[A-Z]+$
          minLength: 3
          maxLength: 6
          description: >-
            Agency code: 3 to 6 uppercase letters. Required on create, immutable
            afterwards (silently ignored on update).
          example: BST
        description:
          type: string
          maxLength: 500
          nullable: true
        website:
          type: string
          format: uri
          maxLength: 255
          nullable: true
        tg_contact:
          type: string
          maxLength: 64
          nullable: true
        email:
          type: string
          nullable: true
          format: email
        email_published:
          type: boolean
        models_count_size:
          type: string
          enum:
            - not_specified
            - '0_10'
            - '10_50'
            - '50_100'
            - 100_plus
        countries:
          oneOf:
            - type: string
              enum:
                - worldwide
            - type: array
              items:
                type: string
                pattern: ^[A-Z]{2}$
          description: >-
            `worldwide` (string), an empty array `[]` (collapses to worldwide),
            or an array of ISO 3166-1 alpha-2 country codes.
        model_commission:
          type: number
          minimum: 0
          maximum: 100
        model_commission_max:
          type: number
          minimum: 0
          maximum: 100
        model_commission_custom:
          type: string
          maxLength: 120
        model_requirements:
          type: string
          maxLength: 2000
        platforms:
          type: array
          maxItems: 10
          items:
            type: string
            enum:
              - onlyfans
              - fansly
        offered_services:
          type: array
          maxItems: 30
          items:
            type: string
            enum:
              - growth_marketing
              - chatting_management
              - social_media_management
              - content_support
              - branding_pr
              - dmca_protection
              - legal_support
              - coaching_consulting
        founded:
          type: string
          format: date
        service_model:
          type: string
          enum:
            - not_specified
            - full_service
            - boutique
            - specialized
            - coaching
          nullable: true
        topagencies_publish:
          type: boolean
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your API key from the Studio Dashboard

````