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

# Reorder billing priorities

> resourceIds is the complete list in highest-first order. Project order includes every active project; customer and number orders include every active customer or real number in projectId. Use scope=resource with projectId and a complete resources array of {scope: customer or number, resourceId} for one mixed leaderboard. Saves the whole order atomically. Concurrent changes or an incomplete list return 409. Retrying the same successful order is harmless. Requires an organization API key with the stated billing scope, or a signed-in team owner or admin. Project and client credentials cannot access these controls. Billing must be configured. Writes require Pay-As-You-Go. These controls never enable charging of unpriced usage.

Requires a team API key with `billing:manage`. Project tokens are not accepted.



## OpenAPI

````yaml api-reference/features/team.json PUT /platform/billing/priorities
openapi: 3.0.3
info:
  title: Teams and accounts API methods
  version: 1.0.0
  description: >-
    Task-focused teams and accounts methods across supported Polymorfa
    connection types.
servers: []
security: []
paths:
  /platform/billing/priorities:
    put:
      tags:
        - Billing
      summary: Reorder billing priorities
      description: >-
        resourceIds is the complete list in highest-first order. Project order
        includes every active project; customer and number orders include every
        active customer or real number in projectId. Use scope=resource with
        projectId and a complete resources array of {scope: customer or number,
        resourceId} for one mixed leaderboard. Saves the whole order atomically.
        Concurrent changes or an incomplete list return 409. Retrying the same
        successful order is harmless. Requires an organization API key with the
        stated billing scope, or a signed-in team owner or admin. Project and
        client credentials cannot access these controls. Billing must be
        configured. Writes require Pay-As-You-Go. These controls never enable
        charging of unpriced usage.


        Requires a team API key with `billing:manage`. Project tokens are not
        accepted.
      operationId: managementReorderBillingPriorities
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  additionalProperties: false
                  properties:
                    scope:
                      type: string
                      enum:
                        - resource
                      description: |-
                        Specifies scope for this one of.

                        <!-- polymorfa-input-table -->
                        **Allowed values**
                        | Value | Meaning |
                        | --- | --- |
                        | `resource` | Resource. |
                    projectId:
                      type: string
                      format: uuid
                      description: >-
                        Identifier of the Polymorfa project that owns this
                        resource.


                        <!-- polymorfa-input-table -->

                        **Value constraints**

                        | Constraint | Accepted input |

                        | --- | --- |

                        | Format | `uuid` |
                    resources:
                      type: array
                      items:
                        type: object
                        additionalProperties: false
                        properties:
                          scope:
                            type: string
                            enum:
                              - customer
                              - number
                            description: |-
                              Specifies scope for this resource.

                              <!-- polymorfa-input-table -->
                              **Allowed values**
                              | Value | Meaning |
                              | --- | --- |
                              | `customer` | Customer. |
                              | `number` | Number. |
                          resourceId:
                            type: string
                            format: uuid
                            description: |-
                              Identifier of the resource affected by this event.

                              <!-- polymorfa-input-table -->
                              **Value constraints**
                              | Constraint | Accepted input |
                              | --- | --- |
                              | Format | `uuid` |
                        required:
                          - scope
                          - resourceId
                      uniqueItems: true
                      maxItems: 1000000
                      description: >-
                        Resources associated with this one of.


                        <!-- polymorfa-input-table -->

                        **Value constraints**

                        | Constraint | Accepted input |

                        | --- | --- |

                        | Array size | At most `1000000` items |

                        | Duplicates | Not accepted; every array item must be
                        unique |
                    expectedRevision:
                      type: integer
                      minimum: 0
                      maximum: 2147483646
                      description: |-
                        Specifies expected revision for this one of.

                        <!-- polymorfa-input-table -->
                        **Value constraints**
                        | Constraint | Accepted input |
                        | --- | --- |
                        | Numeric value | `0` through `2147483646` (inclusive) |
                  required:
                    - scope
                    - projectId
                    - resources
                    - expectedRevision
                - type: object
                  additionalProperties: false
                  properties:
                    scope:
                      type: string
                      enum:
                        - project
                      description: |-
                        Specifies scope for this one of.

                        <!-- polymorfa-input-table -->
                        **Allowed values**
                        | Value | Meaning |
                        | --- | --- |
                        | `project` | Project. |
                    resourceIds:
                      type: array
                      items:
                        type: string
                        format: uuid
                      uniqueItems: true
                      maxItems: 1000000
                      description: >-
                        Resource ids associated with this one of.


                        <!-- polymorfa-input-table -->

                        **Value constraints**

                        | Constraint | Accepted input |

                        | --- | --- |

                        | Array size | At most `1000000` items |

                        | Duplicates | Not accepted; every array item must be
                        unique |

                        | Item format | `uuid` |
                    expectedRevision:
                      type: integer
                      minimum: 0
                      maximum: 2147483646
                      description: |-
                        Specifies expected revision for this one of.

                        <!-- polymorfa-input-table -->
                        **Value constraints**
                        | Constraint | Accepted input |
                        | --- | --- |
                        | Numeric value | `0` through `2147483646` (inclusive) |
                  required:
                    - scope
                    - resourceIds
                    - expectedRevision
                - type: object
                  additionalProperties: false
                  properties:
                    scope:
                      type: string
                      enum:
                        - customer
                        - number
                      description: |-
                        Specifies scope for this one of.

                        <!-- polymorfa-input-table -->
                        **Allowed values**
                        | Value | Meaning |
                        | --- | --- |
                        | `customer` | Customer. |
                        | `number` | Number. |
                    projectId:
                      type: string
                      format: uuid
                      description: >-
                        Identifier of the Polymorfa project that owns this
                        resource.


                        <!-- polymorfa-input-table -->

                        **Value constraints**

                        | Constraint | Accepted input |

                        | --- | --- |

                        | Format | `uuid` |
                    resourceIds:
                      type: array
                      items:
                        type: string
                        format: uuid
                      uniqueItems: true
                      maxItems: 1000000
                      description: >-
                        Resource ids associated with this one of.


                        <!-- polymorfa-input-table -->

                        **Value constraints**

                        | Constraint | Accepted input |

                        | --- | --- |

                        | Array size | At most `1000000` items |

                        | Duplicates | Not accepted; every array item must be
                        unique |

                        | Item format | `uuid` |
                    expectedRevision:
                      type: integer
                      minimum: 0
                      maximum: 2147483646
                      description: |-
                        Specifies expected revision for this one of.

                        <!-- polymorfa-input-table -->
                        **Value constraints**
                        | Constraint | Accepted input |
                        | --- | --- |
                        | Numeric value | `0` through `2147483646` (inclusive) |
                  required:
                    - scope
                    - projectId
                    - resourceIds
                    - expectedRevision
      responses:
        '200':
          description: Success
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Stable request correlation identifier.
            X-Trace-Id:
              schema:
                type: string
                pattern: ^[0-9a-f]{32}$
              description: >-
                W3C trace ID of this request. Your `traceparent` trace ID when
                you sent a valid one.
            Polymorfa-Version:
              schema:
                type: string
              description: API version applied to this response.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/management__BillingPriorities'
                    description: Structured data carried by this object.
                required:
                  - data
        '400':
          $ref: '#/components/responses/management__BadRequest'
        '401':
          $ref: '#/components/responses/management__Unauthorized'
        '403':
          $ref: '#/components/responses/management__Forbidden'
        '404':
          $ref: '#/components/responses/management__NotFound'
        '409':
          $ref: '#/components/responses/management__Conflict'
        '503':
          $ref: '#/components/responses/management__PropagationPending'
      security:
        - management__ApiKeyAuth: []
      servers:
        - url: https://api.polymorfa.com
components:
  schemas:
    management__BillingPriorities:
      type: object
      additionalProperties: false
      properties:
        revision:
          type: integer
          minimum: 0
          maximum: 2147483646
          description: |-
            Specifies revision for this management billing priority.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Numeric value | `0` through `2147483646` (inclusive) |
        projects:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              id:
                type: string
                format: uuid
                description: |-
                  Identifier for this resource.

                  <!-- polymorfa-input-table -->
                  **Value constraints**
                  | Constraint | Accepted input |
                  | --- | --- |
                  | Format | `uuid` |
              name:
                type: string
                description: Human-readable name for this resource.
              priority:
                type: integer
                minimum: 0
                maximum: 1000000
                description: |-
                  Specifies priority for this project.

                  <!-- polymorfa-input-table -->
                  **Value constraints**
                  | Constraint | Accepted input |
                  | --- | --- |
                  | Numeric value | `0` through `1000000` (inclusive) |
            required:
              - id
              - name
              - priority
          description: Projects associated with this management billing priority.
        customers:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              id:
                type: string
                format: uuid
                description: |-
                  Identifier for this resource.

                  <!-- polymorfa-input-table -->
                  **Value constraints**
                  | Constraint | Accepted input |
                  | --- | --- |
                  | Format | `uuid` |
              projectId:
                type: string
                format: uuid
                description: |-
                  Identifier of the Polymorfa project that owns this resource.

                  <!-- polymorfa-input-table -->
                  **Value constraints**
                  | Constraint | Accepted input |
                  | --- | --- |
                  | Format | `uuid` |
              name:
                type: string
                description: Human-readable name for this resource.
              priority:
                type: integer
                minimum: 0
                maximum: 1000000
                description: |-
                  Specifies priority for this customer.

                  <!-- polymorfa-input-table -->
                  **Value constraints**
                  | Constraint | Accepted input |
                  | --- | --- |
                  | Numeric value | `0` through `1000000` (inclusive) |
            required:
              - id
              - projectId
              - name
              - priority
          description: Customers associated with this management billing priority.
        numbers:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              id:
                type: string
                format: uuid
                description: |-
                  Identifier for this resource.

                  <!-- polymorfa-input-table -->
                  **Value constraints**
                  | Constraint | Accepted input |
                  | --- | --- |
                  | Format | `uuid` |
              projectId:
                type: string
                format: uuid
                description: |-
                  Identifier of the Polymorfa project that owns this resource.

                  <!-- polymorfa-input-table -->
                  **Value constraints**
                  | Constraint | Accepted input |
                  | --- | --- |
                  | Format | `uuid` |
              name:
                type: string
                description: Human-readable name for this resource.
              priority:
                type: integer
                minimum: 0
                maximum: 1000000
                description: |-
                  Specifies priority for this number.

                  <!-- polymorfa-input-table -->
                  **Value constraints**
                  | Constraint | Accepted input |
                  | --- | --- |
                  | Numeric value | `0` through `1000000` (inclusive) |
            required:
              - id
              - projectId
              - name
              - priority
          description: Numbers associated with this management billing priority.
      required:
        - revision
        - projects
        - customers
        - numbers
    management__ErrorEnvelope:
      type: object
      required:
        - error
        - data
        - docs
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - param
            - request_id
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - conflict_error
                - rate_limit_error
                - api_error
                - upstream_error
              description: |-
                Type discriminator for this object.

                <!-- polymorfa-input-table -->
                **Allowed values**
                | Value | Meaning |
                | --- | --- |
                | `invalid_request_error` | Invalid request error. |
                | `authentication_error` | Authentication error. |
                | `permission_error` | Permission error. |
                | `conflict_error` | Conflict error. |
                | `rate_limit_error` | Rate limit error. |
                | `api_error` | Api error. |
                | `upstream_error` | Upstream error. |
            code:
              type: string
              description: Stable failure code. Use this value for programmatic handling.
            message:
              type: string
              description: Safe explanation of the failure.
            param:
              type: string
              nullable: true
              description: |-
                Invalid request field, or null when no field applies.

                <!-- polymorfa-input-table -->
                **Accepted alternatives**
                | Alternative | Accepted input |
                | --- | --- |
                | Alternative 1 | Type: `string` |
                | Alternative 2 | `null` |
            request_id:
              type: string
              description: >-
                Matches the X-Request-Id response header. Include it when you
                contact support.
            request_log_url:
              type: string
              format: uri
              description: >-
                Console page that shows this request. Returned only to
                organization and project credentials whose request was logged.


                <!-- polymorfa-input-table -->

                **Value constraints**

                | Constraint | Accepted input |

                | --- | --- |

                | Format | `uri` |
          description: Error details returned when the operation fails.
        data:
          type: string
          nullable: true
          enum:
            - null
          description: |-
            Always null for a failed request.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `null` | Null. |

            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string` |
            | Alternative 2 | `null` |
        docs:
          type: string
          format: uri
          description: |-
            Documentation link to this failure code.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uri` |
  responses:
    management__BadRequest:
      description: A path, query, or request-body value did not pass validation.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        X-Trace-Id:
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
          description: >-
            W3C trace ID of this request. Your `traceparent` trace ID when you
            sent a valid one.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__Unauthorized:
      description: Missing/invalid credential for this audience.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        X-Trace-Id:
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
          description: >-
            W3C trace ID of this request. Your `traceparent` trace ID when you
            sent a valid one.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__Forbidden:
      description: Authenticated but lacks the required scope/role/audience.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        X-Trace-Id:
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
          description: >-
            W3C trace ID of this request. Your `traceparent` trace ID when you
            sent a valid one.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__NotFound:
      description: >-
        The requested resource was not found inside the authenticated team or
        project scope.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        X-Trace-Id:
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
          description: >-
            W3C trace ID of this request. Your `traceparent` trace ID when you
            sent a valid one.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__Conflict:
      description: The request conflicts with the resource's current state.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        X-Trace-Id:
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
          description: >-
            W3C trace ID of this request. Your `traceparent` trace ID when you
            sent a valid one.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__PropagationPending:
      description: >-
        The change was stored, but a connected number has not confirmed it.
        Retry the request; the stored setting is already correct and is retried
        automatically.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        X-Trace-Id:
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
          description: >-
            W3C trace ID of this request. Your `traceparent` trace ID when you
            sent a valid one.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
  securitySchemes:
    management__ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Send your team API key or project token as `Authorization: Bearer
        <token>`. The credential must have the required permissions. Project
        tokens can access only their own project.

````

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