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

# POST /admin/api/credentials/batch



## OpenAPI

````yaml /generated/openapi.json post /admin/api/credentials/batch
openapi: 3.1.0
info:
  description: >-
    Forwarding, management, portal and OAuth APIs generated from Rust types.
    Input and output schemas preserve their respective Serde contracts.
    Streaming events and WebSocket messages are documented alongside HTTP
    payloads.
  title: GPROXY HTTP API
  version: 4.2.1
servers: []
security:
  - bearer: []
  - anthropicKey: []
  - googleKey: []
  - queryKey: []
paths:
  /admin/api/credentials/batch:
    post:
      tags:
        - Management
      summary: POST /admin/api/credentials/batch
      parameters:
        - description: Administrative scope selected by the caller.
          in: header
          name: x-gproxy-admin-scope
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/Input_BatchItem9'
              type: array
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  anyOf:
                    - $ref: '#/components/schemas/Output_CredentialDto'
                    - type: 'null'
                type: array
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_Envelope'
          description: Gateway error
      security:
        - consoleSession: []
        - bearer: []
        - anthropicKey: []
        - googleKey: []
components:
  schemas:
    Input_BatchItem9:
      description: |-
        One step of a batch write. Every item of one batch lands in a single
        revision commit: either all of them are durable or none is.
      oneOf:
        - additionalProperties: false
          properties:
            create:
              $ref: '#/components/schemas/Input_CredentialWrite'
          required:
            - create
          type: object
        - additionalProperties: false
          properties:
            update:
              $ref: '#/components/schemas/Input_BatchPatch9'
          required:
            - update
          type: object
        - additionalProperties: false
          properties:
            delete:
              type: string
          required:
            - delete
          type: object
    Output_CredentialDto:
      description: >-
        A credential without its secret. Only presence and expiry timestamps are

        exposed; reading the material itself requires
        `Credentials::reveal_secret`.
      properties:
        authKind:
          type: string
        connectionProfileId:
          type:
            - string
            - 'null'
        enabled:
          type: boolean
        expiresAtMs:
          format: int64
          type:
            - integer
            - 'null'
        hasSecret:
          type: boolean
        id:
          type: string
        label:
          type:
            - string
            - 'null'
        metadata: true
        organizationId:
          description: 'Opaque to this crate: the application layer decides what owns what.'
          type:
            - string
            - 'null'
        providerId:
          type: string
        proxy:
          default: null
        refreshExpiresAtMs:
          description: >-
            Read-only refresh-token expiry, projected from the sealed secret on
            management reads.

            None means no expiry was reported or the secret could not be read.
          format: int64
          type:
            - integer
            - 'null'
        status:
          description: '`active` or `dead`.'
          type: string
        statusReason:
          type:
            - string
            - 'null'
        teamId:
          type:
            - string
            - 'null'
        userId:
          type:
            - string
            - 'null'
        version:
          description: Bumped by every secret or lifecycle write; peers reload on a change.
          format: int64
          type: integer
      required:
        - id
        - providerId
        - organizationId
        - teamId
        - userId
        - label
        - authKind
        - hasSecret
        - version
        - connectionProfileId
        - proxy
        - metadata
        - expiresAtMs
        - refreshExpiresAtMs
        - status
        - statusReason
        - enabled
      type: object
    Output_Envelope:
      properties:
        error:
          $ref: '#/components/schemas/Output_EnvelopeBody'
      required:
        - error
      type: object
    Input_CredentialWrite:
      properties:
        authKind:
          description: 'How the channel injects it: `api_key`, `oauth`, `cookie`, …'
          type: string
        connectionProfileId:
          default: null
          type:
            - string
            - 'null'
        enabled:
          default: null
          type:
            - boolean
            - 'null'
        expiresAtMs:
          default: null
          format: int64
          type:
            - integer
            - 'null'
        id:
          default: null
          type:
            - string
            - 'null'
        label:
          default: null
          type:
            - string
            - 'null'
        metadata:
          default: null
        organizationId:
          default: null
          type:
            - string
            - 'null'
        providerId:
          type: string
        proxy:
          default: null
        secret:
          description: Plaintext on the way in, sealed before it reaches the database.
        teamId:
          default: null
          type:
            - string
            - 'null'
        userId:
          default: null
          type:
            - string
            - 'null'
      required:
        - providerId
        - authKind
        - secret
      type: object
    Input_BatchPatch9:
      properties:
        id:
          type: string
        patch:
          $ref: '#/components/schemas/Input_CredentialPatch'
      required:
        - id
        - patch
      type: object
    Output_EnvelopeBody:
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    Input_CredentialPatch:
      additionalProperties: false
      description: >-
        Lifecycle status is not here: it is versioned against concurrent
        refreshes

        and changes through `Credentials::set_status`.
      properties:
        connectionProfileId:
          default: null
          type:
            - string
            - 'null'
        enabled:
          default: null
          type:
            - boolean
            - 'null'
        expiresAtMs:
          default: null
          format: int64
          type:
            - integer
            - 'null'
        label:
          default: null
          type:
            - string
            - 'null'
        metadata:
          default: null
        organizationId:
          default: null
          type:
            - string
            - 'null'
        proxy:
          default: null
        secret:
          default: null
          description: >-
            Resealed and version-bumped; peers then reload this credential
            alone.
        teamId:
          default: null
          type:
            - string
            - 'null'
        userId:
          default: null
          type:
            - string
            - 'null'
      type: object
  securitySchemes:
    bearer:
      scheme: bearer
      type: http
    anthropicKey:
      in: header
      name: x-api-key
      type: apiKey
    googleKey:
      in: header
      name: x-goog-api-key
      type: apiKey
    queryKey:
      in: query
      name: key
      type: apiKey
    consoleSession:
      in: cookie
      name: gproxy_session
      type: apiKey

````

## Related topics

- [POST /admin/api/api-keys/batch](https://gproxy.leenhawk.com/api-reference/management/post-adminapiapi-keysbatch.md)
- [POST /admin/api/quotas/batch](https://gproxy.leenhawk.com/api-reference/management/post-adminapiquotasbatch.md)
- [POST /admin/api/credentials](https://gproxy.leenhawk.com/api-reference/management/post-adminapicredentials.md)
- [POST /admin/api/models/batch](https://gproxy.leenhawk.com/api-reference/management/post-adminapimodelsbatch.md)
- [POST /admin/api/organizations/batch](https://gproxy.leenhawk.com/api-reference/management/post-adminapiorganizationsbatch.md)


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