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

# Issue an access token for a plugin installation

> <Badge color="blue" size="sm" shape="pill">Plugins</Badge>

**Accepted credentials:** Plugin JWT.

Called by the plugin with a JWT it signed for the installation. A token this core issued is refused. A request with a repository_id scopes the token to that repository. A request with no repository_id takes every permission the installation holds, only repositories:create, or only installations:read. A repositories:create token reaches no repository; it creates repositories in the installation's project through POST /api/v1/repos.



## OpenAPI

````yaml /openapi/core.json post /plugins/{plugin}/installations/{id}/access-tokens
openapi: 3.1.0
info:
  description: >-
    Entire control plane: identity, orgs, projects, repos, mirrors, service
    accounts.
  title: Entire Core API
  version: 1.0.0
servers:
  - url: https://us.auth.entire.io/api/v1
security: []
tags:
  - name: identity
    x-group: Account
  - name: orgs
    x-group: Organizations
  - name: projects
    x-group: Projects
  - name: repos
    x-group: Repositories
  - name: clusters
    x-group: Clusters
  - name: service-accounts
    x-group: Service accounts
  - name: limits
    x-group: Limits
  - name: plugins
    x-group: Plugins
paths:
  /plugins/{plugin}/installations/{id}/access-tokens:
    post:
      tags:
        - plugins
      summary: Issue an access token for a plugin installation
      description: >-
        <Badge color="blue" size="sm" shape="pill">Plugins</Badge>


        **Accepted credentials:** Plugin JWT.


        Called by the plugin with a JWT it signed for the installation. A token
        this core issued is refused. A request with a repository_id scopes the
        token to that repository. A request with no repository_id takes every
        permission the installation holds, only repositories:create, or only
        installations:read. A repositories:create token reaches no repository;
        it creates repositories in the installation's project through POST
        /api/v1/repos.
      operationId: createPluginInstallationAccessToken
      parameters:
        - description: Plugin slug
          in: path
          name: plugin
          required: true
          schema:
            description: Plugin slug
            type: string
        - description: Installation id
          in: path
          name: id
          required: true
          schema:
            description: Installation id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              contentMediaType: application/octet-stream
              format: binary
              type: string
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginAccessTokenOutputBody'
          description: Created
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            The request body is invalid, or names a repository_id with
            repositories:create (code invalid_request, unsupported_permission,
            repository_required). The cursor, per_page, or q is invalid, or the
            cursor was issued for another q (code bad_request).
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The bearer token is missing or not valid (code unauthorized).
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            The token is not for this installation, core refused the token
            exchange (code forbidden), the installation is suspended (code
            installation_suspended), or the installation has not accepted a
            requested permission (code permission_not_accepted).
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            The plugin, installation, or repository is not served here (code
            not_found).
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            The installation's repositories changed during the mint; retry (code
            coverage_changed). The installation changed during a repository
            walk; restart from the first page (code conflict).
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            The installation's token mint limit is exhausted; retry after
            Retry-After seconds (code rate_limited).
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: A dependency is unavailable; retry (code unavailable).
      security:
        - pluginToken: []
components:
  schemas:
    PluginAccessTokenOutputBody:
      additionalProperties: true
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - /api/v1/schemas/PluginAccessTokenOutputBody.json
          format: uri
          readOnly: true
          type: string
        expires_at:
          format: date-time
          type: string
        permissions:
          additionalProperties:
            type: string
          type: object
        token:
          type: string
        username:
          type: string
      required:
        - token
        - username
        - expires_at
        - permissions
      type: object
    Problem:
      additionalProperties: true
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - /api/v1/schemas/Problem.json
          format: uri
          readOnly: true
          type: string
        api_base_url:
          description: 'wrong_cell only: the processing primary''s API base URL to retry.'
          type: string
        code:
          description: Stable machine-readable code (not_found, no_primary, wrong_cell, …).
          type: string
        detail:
          description: >-
            Human-readable sentence. Can change any time — branch on code, never
            on detail.
          type: string
        errors:
          description: >-
            The fields that failed request validation, one entry for each
            failure.
          items:
            $ref: '#/components/schemas/FieldError'
          type: array
        git_command:
          description: >-
            moved only: the git command that points an existing clone at the new
            address.
          type: string
        moved_to:
          description: >-
            moved only: the repo path that now holds the repo (e.g.
            "et/acme/api").
          type: string
        region:
          description: 'wrong_cell only: the processing primary''s public region name.'
          type: string
        request_id:
          description: >-
            Opaque id for this request; give it to support to locate server
            logs.
          type: string
        status:
          description: HTTP status code.
          format: int64
          type: integer
        title:
          description: Short human summary of the status.
          type: string
        type:
          description: URL of this error's documentation page.
          format: uri
          type: string
      required:
        - type
        - title
        - status
        - code
      type: object
    FieldError:
      additionalProperties: true
      properties:
        location:
          description: Path of the field, such as body.slug.
          type: string
        message:
          description: Why the field failed validation.
          type: string
      required:
        - location
        - message
      type: object
  securitySchemes:
    pluginToken:
      bearerFormat: JWT
      description: >-
        A JWT the plugin signs with its registered keys, for the installation it
        names.
      scheme: bearer
      type: http

````