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

# Mint or rotate the application's registry robot

> Make sure a push robot minted for this application backs its repository login: mint one when none does (with Ankra's registry administrator on the organisation's own registry, or with image_registry.admin_credential_name on a registry the organisation operates), refresh its secret when rotate is set, store the login as the platform-managed registry credential ankra-harbor-app-<application-id>, and write it into the repository's Actions secrets. A registry Ankra cannot administer answers 200 with provisioned false and a message naming what would let it. A browser session twin is mounted at the same path without the /api/v1 prefix (cookie authentication).



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /api/v1/org/applications/{application_id}/registry-robot
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /api/v1/org/applications/{application_id}/registry-robot:
    post:
      tags:
        - applications
      summary: Mint or rotate the application's registry robot
      description: >-
        Make sure a push robot minted for this application backs its repository
        login: mint one when none does (with Ankra's registry administrator on
        the organisation's own registry, or with
        image_registry.admin_credential_name on a registry the organisation
        operates), refresh its secret when rotate is set, store the login as the
        platform-managed registry credential ankra-harbor-app-<application-id>,
        and write it into the repository's Actions secrets. A registry Ankra
        cannot administer answers 200 with provisioned false and a message
        naming what would let it. A browser session twin is mounted at the same
        path without the /api/v1 prefix (cookie authentication).
      operationId: >-
        ensure_application_registry_robot_api_v1_org_applications__application_id__registry_robot_post
      parameters:
        - in: path
          name: application_id
          required: true
          schema:
            title: Application Id
            type: string
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: x-ankra-organisation-id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Ankra-Organisation-Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnsureApplicationRegistryRobotRequest'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationRegistryRobotResult'
          description: Successful Response
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Application not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    EnsureApplicationRegistryRobotRequest:
      properties:
        rotate:
          default: false
          description: >-
            Refresh the robot's secret even when one already backs the
            application; the previous secret stops working immediately.
          title: Rotate
          type: boolean
      title: EnsureApplicationRegistryRobotRequest
      type: object
    ApplicationRegistryRobotResult:
      properties:
        changed:
          description: A robot was minted, rotated or revoked in this call.
          title: Changed
          type: boolean
        message:
          title: Message
          type: string
        needs_app_admin:
          description: >-
            GitHub refused the secrets write because the Ankra GitHub App lacks
            the Secrets permission.
          title: Needs App Admin
          type: boolean
        robot:
          $ref: '#/components/schemas/ApplicationRegistryRobot'
        secrets_written:
          description: The repository's Actions secrets now carry the robot login.
          title: Secrets Written
          type: boolean
      required:
        - robot
        - changed
        - secrets_written
        - needs_app_admin
        - message
      title: ApplicationRegistryRobotResult
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ApplicationRegistryRobot:
      properties:
        created_at:
          title: Created At
          type: string
        credential_name:
          description: Registry credential holding the robot login.
          title: Credential Name
          type: string
        declared:
          description: >-
            The robot lives on a registry the organisation operates rather than
            on Ankra's.
          title: Declared
          type: boolean
        host:
          title: Host
          type: string
        manageable:
          description: >-
            Ankra can mint and rotate a robot on this registry: always on the
            organisation's own registry, and on a declared registry once
            admin_credential_name names a robot administrator.
          title: Manageable
          type: boolean
        message:
          description: >-
            Why no robot is provisioned or manageable, and what would change
            that.
          title: Message
          type: string
        password_secret_name:
          title: Password Secret Name
          type: string
        project:
          title: Project
          type: string
        provisioned:
          description: >-
            A push robot minted on the registry the application publishes to
            backs its repository login.
          title: Provisioned
          type: boolean
        robot_name:
          title: Robot Name
          type: string
        rotated_at:
          title: Rotated At
          type: string
        stale:
          description: >-
            The recorded robot was minted on a registry the application no
            longer publishes to.
          title: Stale
          type: boolean
        username_secret_name:
          title: Username Secret Name
          type: string
      required:
        - provisioned
        - manageable
        - robot_name
        - credential_name
        - host
        - project
        - declared
        - created_at
        - rotated_at
        - stale
        - username_secret_name
        - password_secret_name
        - message
      title: ApplicationRegistryRobot
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````