> ## 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.

# Update

> Edit an agency.



## OpenAPI

````yaml POST /agencies/{uuid}
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/{uuid}:
    post:
      tags:
        - Agencies
      summary: Update
      description: Edit an agency.
      operationId: updateAgency
      parameters:
        - $ref: '#/components/parameters/AgencyIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgencyWriteable'
      responses:
        '200':
          description: >-
            Changes are staged in the moderation queue. The agency row only
            flips to the new state once an admin approves the pending review;
            until then, list endpoints continue to return the prior values.
            Returns `status: "moderation"` while the change is pending.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      status:
                        type: string
                        enum:
                          - active
                          - moderation
                          - disabled
                        description: >-
                          `moderation` when the change went into the review
                          queue; `active` when the request was a no-op.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Agency not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Validation error. Returned for invalid field values, for the agency
            being disabled, or for any attempt to modify the immutable triple
            `name` / `slug` / `code` (set once at creation).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    AgencyIdPath:
      name: uuid
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Agency UUID. Use the `uuid` value from the agency response.
      example: 550e8400-e29b-41d4-a716-446655440000
  schemas:
    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
    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.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your API key from the Studio Dashboard

````