Codefresh Tokens API

tokens

Operations 10

GET /auth/key/service-user/{serviceUserId}/{id} Get token info for service account #
PATCH /auth/key/service-user/{serviceUserId}/{id} Update token for service account #
DELETE /auth/key/service-user/{serviceUserId}/{id} Delete token for service account #
POST /auth/key/service-user/{serviceUserId} Generate token for service account #
GET /auth/key/service-user/{serviceUserId} List service accounts tokens #
POST /auth/key Generate #
GET /auth/key/{id} Get #
PATCH /auth/key/{id} Patch #
DELETE /auth/key/{id} Delete #
GET /auth/keys List #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/codefresh:codefresh-tokens-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

codefresh-tokens-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    name: Codefresh
    url: https://www.codefresh.io
  description: Codefresh API openAPI 3.0 specification
  termsOfService: https://codefresh.io/docs/docs/terms-and-privacy-policy/terms-of-service/
  title: Codefresh Tokens API
  version: 0.0.2
  x-logo:
    url: https://g.codefresh.io/modules/cf.resources/codefresh-api-docs-images/codefresh-logo-api.svg
    backgroundColor: '#FFFFFF'
    altText: Codefresh
servers:
- url: https://g.codefresh.io/api
security:
- API-key: []
tags:
- name: Tokens
  description: tokens
  x-id: tokens
paths:
  /auth/key/service-user/{serviceUserId}/{id}:
    get:
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Tokens
      operationId: service-user-token-by-id
      parameters:
      - description: The id of the service account
        in: path
        name: serviceUserId
        required: true
        schema:
          type: string
      - description: The id of the token service account
        in: path
        name: id
        required: true
        schema:
          type: string
      summary: Get token info for service account
      x-sdk-interface: serviceUser.getTokenById
      x-endpoint:
        isEndpoint: false
        auth:
          middleware:
          - auth.isAuthenticated
          - auth.isAccountAdmin
          acl:
            resource: api-keys
            scope: read
        postMiddleware:
        - global.iseMiddleware
        handler: api-key.getTokenByIdForServiceUser
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/auth/key/service-user/${SERVICE_USER_ID}/${ID}\""
      - lang: node.js
        source: sdk.serviceUser.getTokenById({ serviceUserId, id })
    patch:
      x-action: updateApiKeyForServiceUser
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Tokens
      operationId: service-user-token-patch
      parameters:
      - description: The id of the service account
        in: path
        name: serviceUserId
        required: true
        schema:
          type: string
      - description: The id of the token service account
        in: path
        name: id
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              x-allowed:
                body:
                - name
                - scopes
      summary: Update token for service account
      x-sdk-interface: serviceUser.patchTokenById
      x-endpoint:
        isEndpoint: false
        auth:
          middleware:
          - auth.isAuthenticated
          - auth.isAccountAdmin
          acl:
            resource: api-keys
            scope: update
        postMiddleware:
        - global.iseMiddleware
        handler: api-key.patchTokenForServiceUser
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X PATCH \\\n    -H \"Authorization: ${API_KEY}\" \\\n    -H 'Content-Type: application/json; charset=utf-8' \\\n    -d \"${REQUEST_BODY_OBJ}\" \\\n    \"https://g.codefresh.io/api/auth/key/service-user/${SERVICE_USER_ID}/${ID}\""
      - lang: node.js
        source: sdk.serviceUser.patchTokenById({ serviceUserId, id }, { ...REQUEST_BODY_OBJ })
    delete:
      x-action: deleteApiKeyForServiceUser
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Tokens
      operationId: service-user-token-delete
      parameters:
      - description: The id of the service account
        in: path
        name: serviceUserId
        required: true
        schema:
          type: string
      - description: The id of the token service account
        in: path
        name: id
        required: true
        schema:
          type: string
      summary: Delete token for service account
      x-sdk-interface: serviceUser.deleteTokenById
      x-endpoint:
        isEndpoint: false
        auth:
          middleware:
          - auth.isAuthenticated
          - auth.isAccountAdmin
          acl:
            resource: api-keys
            scope: delete
        postMiddleware:
        - global.iseMiddleware
        handler: api-key.deleteTokenForServiceUser
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X DELETE \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/auth/key/service-user/${SERVICE_USER_ID}/${ID}\""
      - lang: node.js
        source: sdk.serviceUser.deleteTokenById({ serviceUserId, id })
  /auth/key/service-user/{serviceUserId}:
    post:
      x-action: createApiKeyForServiceUser
      x-entityId:
        pathName: body.name
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Tokens
      operationId: tokens-generate-for-service-user
      parameters:
      - description: The id of the service-user
        in: path
        name: serviceUserId
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              x-allowed:
                body:
                - name
                - scopes
      summary: Generate token for service account
      x-sdk-interface: serviceUser.generateToken
      x-endpoint:
        isEndpoint: false
        auth:
          middleware:
          - auth.isAuthenticated
          - auth.isAccountAdmin
          acl:
            resource: api-keys
            scope: create
        preMiddleware:
        - auth.hasEnoughScopeToChangeScope
        postMiddleware:
        - global.iseMiddleware
        handler: api-key.createNewTokenForServiceUser
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X POST \\\n    -H \"Authorization: ${API_KEY}\" \\\n    -H 'Content-Type: application/json; charset=utf-8' \\\n    -d \"${REQUEST_BODY_OBJ}\" \\\n    \"https://g.codefresh.io/api/auth/key/service-user/${SERVICE_USER_ID}\""
      - lang: node.js
        source: sdk.serviceUser.generateToken({ serviceUserId }, { ...REQUEST_BODY_OBJ })
    get:
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Tokens
      operationId: service-user-tokens-list
      parameters:
      - description: The id of the service account
        in: path
        name: serviceUserId
        required: true
        schema:
          type: string
      summary: List service accounts tokens
      x-sdk-interface: serviceUser.tokensList
      x-endpoint:
        isEndpoint: false
        auth:
          middleware:
          - auth.isAuthenticated
          - auth.isAccountAdmin
          acl:
            resource: api-keys
            scope: read
        postMiddleware:
        - global.iseMiddleware
        handler: api-key.getTokensForServiceUser
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/auth/key/service-user/${SERVICE_USER_ID}\""
      - lang: node.js
        source: sdk.serviceUser.tokensList({ serviceUserId })
  /auth/key:
    post:
      x-action: createApiKey
      x-entityId:
        pathName: body.name
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Tokens
      operationId: tokens-generate
      parameters:
      - in: query
        name: subjectType
        schema:
          type: string
        description: Subject type
      - in: query
        name: subjectReference
        schema:
          type: string
        description: Subject reference
      requestBody:
        content:
          application/json:
            schema:
              type: object
      summary: Generate
      x-sdk-interface: tokens.generate
      x-endpoint:
        isEndpoint: false
        auth:
          middleware:
          - auth.isAuthenticated
          acl:
            resource: api-keys
            scope: create
        preMiddleware:
        - auth.hasEnoughScopeToChangeScope
        postMiddleware:
        - global.iseMiddleware
        handler: api-key.createNewToken
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X POST \\\n    -H \"Authorization: ${API_KEY}\" \\\n    -H 'Content-Type: application/json; charset=utf-8' \\\n    -d \"${REQUEST_BODY_OBJ}\" \\\n    \"https://g.codefresh.io/api/auth/key?subjectType=${SUBJECT_TYPE}&subjectReference=${SUBJECT_REFERENCE}\""
      - lang: node.js
        source: sdk.tokens.generate({ subjectType, subjectReference }, { ...REQUEST_BODY_OBJ })
  /auth/key/{id}:
    get:
      x-action: getTokenById
      x-entityId: params.id
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Tokens
      operationId: tokens-get-by-id
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: Id
      summary: Get
      x-sdk-interface: tokens.get
      x-endpoint:
        isEndpoint: false
        auth:
          middleware:
          - auth.isAuthenticated
          acl:
            resource: api-keys
            scope: read
        postMiddleware:
        - global.iseMiddleware
        handler: api-key.getTokenById
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/auth/key/${ID}\""
      - lang: node.js
        source: sdk.tokens.get({ id })
    patch:
      responses:
        '200':
          description: ok
      tags:
      - Tokens
      operationId: tokens-patch
      parameters:
      - in: path
        name: id
        schema:
          type: string
        description: build id
        required: true
      summary: Patch
      x-sdk-interface: tokens.patch
      requestBody:
        content:
          application/json:
            schema:
              type: object
      x-endpoint:
        isEndpoint: false
        auth:
          middleware:
          - auth.isAuthenticated
          acl:
            resource: api-keys
            scope: update
        preMiddleware:
        - auth.hasEnoughScopeToChangeScope
        postMiddleware:
        - global.iseMiddleware
        handler: api-key.patchToken
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X PATCH \\\n    -H \"Authorization: ${API_KEY}\" \\\n    -H 'Content-Type: application/json; charset=utf-8' \\\n    -d \"${REQUEST_BODY_OBJ}\" \\\n    \"https://g.codefresh.io/api/auth/key/${ID}\""
      - lang: node.js
        source: sdk.tokens.patch({ id }, { ...REQUEST_BODY_OBJ })
    delete:
      x-action: deleteApiKey
      x-entityId: params.id
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Tokens
      operationId: tokens-delete
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: Id
      summary: Delete
      x-sdk-interface: tokens.delete
      x-endpoint:
        isEndpoint: false
        auth:
          middleware:
          - auth.isAuthenticated
          acl:
            resource: api-keys
            scope: delete
        postMiddleware:
        - global.iseMiddleware
        handler: api-key.deleteToken
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X DELETE \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/auth/key/${ID}\""
      - lang: node.js
        source: sdk.tokens.delete({ id })
  /auth/keys:
    get:
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: json
      tags:
      - Tokens
      operationId: tokens-list
      parameters: []
      summary: List
      x-sdk-interface: tokens.list
      x-endpoint:
        isEndpoint: false
        auth:
          middleware:
          - auth.isAuthenticated
          acl:
            resource: api-keys
            scope: read
        postMiddleware:
        - global.iseMiddleware
        handler: api-key.getTokens
      x-code-samples:
      - lang: curl
        source: "curl  \\\n    -X GET \\\n    -H \"Authorization: ${API_KEY}\" \\\n    \"https://g.codefresh.io/api/auth/keys\""
      - lang: node.js
        source: sdk.tokens.list()
components:
  securitySchemes:
    API-key:
      in: header
      name: Authorization
      description: 'An api key got from: User Settings -> API keys -> Generate'
      type: apiKey
x-service-name: api-public
x-base-path: /api
x-internal-services:
- pipeline-manager
- api
x-endpoint-conditions:
- weight: 0
  condition: global.has-general-service-role
  handlerRegex: (.*)
- weight: 1
  condition: global.has-kubernetes-endpoints-service-role
  handlerRegex: kubernetes\.\w+
- weight: 2
  condition: global.has-auth-service-role
  handlerRegex: api-key\.\w+
x-tagGroups:
- name: Pipelines / Builds
  tags:
  - Annotations
  - Builds
  - Execution Contexts
  - Images
  - Pipelines
  - Progress
  - Projects
  - Step-types
  - Triggers
  - Triggers Events
  - Triggers Types
- name: Kubernetes / Helm
  tags:
  - Environments V2
  - Helm Boards
  - Helm Charts
  - Helm Releases
  - Helm Sections
  - Kubernetes
- name: Swarm
  tags:
  - Compositions
  - Environments
- name: Integrations / Contexts
  tags:
  - Clusters
  - Contexts
  - Helm Cluster Configs
  - Helm Repos
  - Registries
  - Repos
- name: Account Management
  tags:
  - Abac
  - Accounts
  - Agents
  - Audit
  - Runtime Environments
  - Teams
  - Tokens
  - Views
- name: User Properties
  tags:
  - favorites
- name: On-Premise
  tags:
  - Features
  - Runtime Environments (Account)
  - Runtime Environments (Plan)
  - Runtime Environments (System)
  - Runtime Environments.
- name: Platform Analytics
  tags:


# --- truncated at 32 KB (139 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/codefresh/refs/heads/main/openapi/codefresh-tokens-api-openapi.yml