Semaphore ProjectSecrets API

Project-level secrets

OpenAPI Specification

semaphore-projectsecrets-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Semaphore Public Dashboards ProjectSecrets API
  description: 'The Semaphore Public API is a RESTful API that allows you to interact with Semaphore CI/CD.

    ## Authorization

    Authorization is done via bearer token. You can obtain a token by visiting your [account settings](https://me.semaphoreci.com/account).


    ## Pagination with link headers

    Each list request supports pagination. List responses include a [link header](https://datatracker.ietf.org/doc/html/rfc5988#section-5) with the pagination URLs.

    Link headers contain next, previous, first relative URLs.

    '
  version: v2
  contact:
    url: https://semaphore.io/contact
    email: support@semaphoreci.com
  termsOfService: https://semaphore.io/terms
  license:
    name: Proprietary
    url: https://semaphore.io/terms
servers:
- url: https://{org_name}.semaphoreci.com/api/v2
  variables:
    org_name:
      default: me
      description: Organization name
security:
- authorization: []
tags:
- name: ProjectSecrets
  description: Project-level secrets
paths:
  /projects/{project_id_or_name}/secrets:
    post:
      operationId: ProjectSecrets.Create
      description: Create a project scoped secret.
      tags:
      - ProjectSecrets
      parameters:
      - description: Id or name of the project
        in: path
        name: project_id_or_name
        required: true
        schema:
          anyOf:
          - description: ID of a Project
            example: c3528752-03d4-4a80-9da6-4f851bed62ad
            format: uuid
            title: Project.ID
            type: string
          - description: Project name must match the regex
            example: my-project
            minLength: 1
            pattern: \A[\w\-\.]+\z
            title: Project.Name
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                apiVersion:
                  default: v2
                  description: "ApiVersion defines the versioned schema of this representation of an object.\n        Servers should convert recognized schemas to the latest internal value, and may reject\n        unrecognized values."
                  example: v2
                  readOnly: true
                  title: ApiVersion
                  type: string
                kind:
                  default: ProjectSecret
                  description: "Kind is a string value representing the REST resource this object represents.\n        Servers may infer this from the endpoint the client submits requests to. Cannot be\n        updated. In CamelCase."
                  example: ProjectSecret
                  readOnly: true
                  title: Kind
                  type: string
                metadata:
                  description: Metadata of the secret, all fields are read only
                  properties:
                    created_at:
                      description: Timestamp in ISO 8601 format
                      format: date-time
                      title: Timestamp
                      type: string
                    created_by:
                      properties:
                        id:
                          description: ID of a User
                          example: 18b40eaf-ce10-49c3-93f2-e4fe72d5160b
                          format: uuid
                          title: User.ID
                          type: string
                      title: User
                      type: object
                    description:
                      description: Description of the secret
                      type: string
                    id:
                      description: ID of a Secret
                      example: abbb5683-9310-49bb-9fd2-ac69486a4c6d
                      format: uuid
                      title: Secret.ID
                      type: string
                    last_used_at:
                      description: Last time the secret was used in a job
                      format: date-time
                      nullable: true
                      title: Timestamp
                      type: string
                    last_used_by:
                      description: Collected information about last usage of the secret
                      nullable: true
                      properties:
                        hook_id:
                          description: ID of a Hook
                          example: c0798875-7908-456b-ab3e-78de8247b6e0
                          format: uuid
                          title: Hook.ID
                          type: string
                        job_id:
                          description: ID of a Job
                          example: 7ce0901c-84b0-4bb4-ab96-f0a4b15ae52d
                          format: uuid
                          title: Job.ID
                          type: string
                        pipeline_id:
                          description: ID of a Pipeline
                          example: 4cd4fdb9-4248-4348-932c-855746110bcc
                          format: uuid
                          title: Pipeline.ID
                          type: string
                        project_id:
                          description: ID of a Project
                          example: 1c306e24-af58-4e95-8cd9-27e9a1a36428
                          format: uuid
                          title: Project.ID
                          type: string
                        user_id:
                          description: ID of a User
                          example: 7a8f94b1-c5b6-4195-82ca-f68664fa832b
                          format: uuid
                          title: User.ID
                          type: string
                        workflow_id:
                          description: ID of a Workflow
                          example: 40dcd7b2-3e42-4958-8c08-7eb5aa8690f6
                          format: uuid
                          title: Workflow.ID
                          type: string
                      title: Secrets.Checkout
                      type: object
                    name:
                      description: Secret name must match the regex
                      example: my-secret
                      minLength: 1
                      pattern: '^[@: -._a-zA-Z0-9]+$'
                      title: Secret.Name
                      type: string
                    org_id:
                      description: ID of a Organization
                      example: f0f54dbb-0f70-444f-ad99-773830e2428b
                      format: uuid
                      title: Organization.ID
                      type: string
                    project_id:
                      description: ID of a Project
                      example: afed5713-8c6e-4081-bdae-7030cebf24b6
                      format: uuid
                      title: Project.ID
                      type: string
                    updated_at:
                      description: Timestamp in ISO 8601 format
                      format: date-time
                      title: Timestamp
                      type: string
                    updated_by:
                      properties:
                        id:
                          description: ID of a User
                          example: 18b40eaf-ce10-49c3-93f2-e4fe72d5160b
                          format: uuid
                          title: User.ID
                          type: string
                      title: User
                      type: object
                  readOnly: true
                  required:
                  - id
                  - name
                  - org_id
                  - project_id
                  type: object
                spec:
                  description: Specification of the secret
                  properties:
                    data:
                      description: Data of the secret, both env_vars and files are required but can be empty
                      properties:
                        env_vars:
                          description: Value of the secret
                          items:
                            description: Environment variable
                            properties:
                              name:
                                description: Name of the environment variable
                                example: ENV_VAR_NAME
                                minLength: 1
                                type: string
                              value:
                                description: Value of the environment variable, or a md5 checksum
                                type: string
                            required:
                            - name
                            - value
                            type: object
                          type: array
                        files:
                          description: Files of the secret
                          items:
                            description: File
                            properties:
                              content:
                                description: base64 encoded content of the file or a md5 checksum
                                type: string
                              path:
                                description: Name of the file. Both absolute and relative paths are allowed.
                                example: /path/to/file
                                minLength: 1
                                type: string
                            required:
                            - path
                            - content
                            type: object
                          type: array
                      required:
                      - env_vars
                      - files
                      type: object
                    description:
                      description: Description of the secret
                      type: string
                    name:
                      description: Secret name must match the regex
                      example: my-secret
                      minLength: 1
                      pattern: '^[@: -._a-zA-Z0-9]+$'
                      title: Secret.Name
                      type: string
                  required:
                  - name
                  - data
                  type: object
              required:
              - apiVersion
              - kind
              - metadata
              - spec
              title: ProjectSecrets.Secret
              type: object
        description: Secret to be created
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  apiVersion:
                    default: v2
                    description: "ApiVersion defines the versioned schema of this representation of an object.\n        Servers should convert recognized schemas to the latest internal value, and may reject\n        unrecognized values."
                    example: v2
                    readOnly: true
                    title: ApiVersion
                    type: string
                  kind:
                    default: ProjectSecret
                    description: "Kind is a string value representing the REST resource this object represents.\n        Servers may infer this from the endpoint the client submits requests to. Cannot be\n        updated. In CamelCase."
                    example: ProjectSecret
                    readOnly: true
                    title: Kind
                    type: string
                  metadata:
                    description: Metadata of the secret, all fields are read only
                    properties:
                      created_at:
                        description: Timestamp in ISO 8601 format
                        format: date-time
                        title: Timestamp
                        type: string
                      created_by:
                        properties:
                          id:
                            description: ID of a User
                            example: 18b40eaf-ce10-49c3-93f2-e4fe72d5160b
                            format: uuid
                            title: User.ID
                            type: string
                        title: User
                        type: object
                      description:
                        description: Description of the secret
                        type: string
                      id:
                        description: ID of a Secret
                        example: abbb5683-9310-49bb-9fd2-ac69486a4c6d
                        format: uuid
                        title: Secret.ID
                        type: string
                      last_used_at:
                        description: Last time the secret was used in a job
                        format: date-time
                        nullable: true
                        title: Timestamp
                        type: string
                      last_used_by:
                        description: Collected information about last usage of the secret
                        nullable: true
                        properties:
                          hook_id:
                            description: ID of a Hook
                            example: c0798875-7908-456b-ab3e-78de8247b6e0
                            format: uuid
                            title: Hook.ID
                            type: string
                          job_id:
                            description: ID of a Job
                            example: 7ce0901c-84b0-4bb4-ab96-f0a4b15ae52d
                            format: uuid
                            title: Job.ID
                            type: string
                          pipeline_id:
                            description: ID of a Pipeline
                            example: 4cd4fdb9-4248-4348-932c-855746110bcc
                            format: uuid
                            title: Pipeline.ID
                            type: string
                          project_id:
                            description: ID of a Project
                            example: 1c306e24-af58-4e95-8cd9-27e9a1a36428
                            format: uuid
                            title: Project.ID
                            type: string
                          user_id:
                            description: ID of a User
                            example: 7a8f94b1-c5b6-4195-82ca-f68664fa832b
                            format: uuid
                            title: User.ID
                            type: string
                          workflow_id:
                            description: ID of a Workflow
                            example: 40dcd7b2-3e42-4958-8c08-7eb5aa8690f6
                            format: uuid
                            title: Workflow.ID
                            type: string
                        title: Secrets.Checkout
                        type: object
                      name:
                        description: Secret name must match the regex
                        example: my-secret
                        minLength: 1
                        pattern: '^[@: -._a-zA-Z0-9]+$'
                        title: Secret.Name
                        type: string
                      org_id:
                        description: ID of a Organization
                        example: f0f54dbb-0f70-444f-ad99-773830e2428b
                        format: uuid
                        title: Organization.ID
                        type: string
                      project_id:
                        description: ID of a Project
                        example: afed5713-8c6e-4081-bdae-7030cebf24b6
                        format: uuid
                        title: Project.ID
                        type: string
                      updated_at:
                        description: Timestamp in ISO 8601 format
                        format: date-time
                        title: Timestamp
                        type: string
                      updated_by:
                        properties:
                          id:
                            description: ID of a User
                            example: 18b40eaf-ce10-49c3-93f2-e4fe72d5160b
                            format: uuid
                            title: User.ID
                            type: string
                        title: User
                        type: object
                    readOnly: true
                    required:
                    - id
                    - name
                    - org_id
                    - project_id
                    type: object
                  spec:
                    description: Specification of the secret
                    properties:
                      data:
                        description: Data of the secret, both env_vars and files are required but can be empty
                        properties:
                          env_vars:
                            description: Value of the secret
                            items:
                              description: Environment variable
                              properties:
                                name:
                                  description: Name of the environment variable
                                  example: ENV_VAR_NAME
                                  minLength: 1
                                  type: string
                                value:
                                  description: Value of the environment variable, or a md5 checksum
                                  type: string
                              required:
                              - name
                              - value
                              type: object
                            type: array
                          files:
                            description: Files of the secret
                            items:
                              description: File
                              properties:
                                content:
                                  description: base64 encoded content of the file or a md5 checksum
                                  type: string
                                path:
                                  description: Name of the file. Both absolute and relative paths are allowed.
                                  example: /path/to/file
                                  minLength: 1
                                  type: string
                              required:
                              - path
                              - content
                              type: object
                            type: array
                        required:
                        - env_vars
                        - files
                        type: object
                      description:
                        description: Description of the secret
                        type: string
                      name:
                        description: Secret name must match the regex
                        example: my-secret
                        minLength: 1
                        pattern: '^[@: -._a-zA-Z0-9]+$'
                        title: Secret.Name
                        type: string
                    required:
                    - name
                    - data
                    type: object
                required:
                - apiVersion
                - kind
                - metadata
                - spec
                title: ProjectSecrets.Secret
                type: object
          description: Created secret
        '400':
          content:
            application/json:
              schema:
                properties:
                  documentation_url:
                    example: https://docs.semaphoreci.com/api/error-codes/bad-request
                    format: uri
                    type: string
                  message:
                    type: string
                title: Error
                type: object
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                properties:
                  documentation_url:
                    example: https://docs.semaphoreci.com/api/error-codes/bad-request
                    format: uri
                    type: string
                  message:
                    type: string
                title: Error
                type: object
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                properties:
                  documentation_url:
                    example: https://docs.semaphoreci.com/api/error-codes/bad-request
                    format: uri
                    type: string
                  message:
                    type: string
                title: Error
                type: object
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                description: Resource validation failed
                properties:
                  documentation_url:
                    example: https://docs.semaphoreci.com/api/error-codes/bad-request
                    format: uri
                    type: string
                  errors:
                    items:
                      properties:
                        field:
                          type: string
                        message:
                          type: string
                      type: object
                    type: array
                  message:
                    type: string
                title: Error.Validation
                type: object
          description: Validation Failed
        '500':
          content:
            application/json:
              schema:
                properties:
                  documentation_url:
                    example: https://docs.semaphoreci.com/api/error-codes/bad-request
                    format: uri
                    type: string
                  message:
                    type: string
                title: Error
                type: object
          description: Internal Server Error
      security:
      - authorization: []
    get:
      operationId: ProjectSecrets.List
      description: "List all project level secrets in a project.\n      If the response does not fit all the secrets refer to the link header to get next page url."
      tags:
      - ProjectSecrets
      parameters:
      - description: Id or name of the project
        in: path
        name: project_id_or_name
        required: true
        schema:
          anyOf:
          - description: ID of a Project
            example: e0fe5f6d-5e5b-41b0-b63a-c086b6ae704b
            format: uuid
            title: Project.ID
            type: string
          - description: Project name must match the regex
            example: my-project
            minLength: 1
            pattern: \A[\w\-\.]+\z
            title: Project.Name
            type: string
      - description: Ordering of the secrets
        in: query
        name: order
        required: false
        schema:
          default: BY_NAME_ASC
          enum:
          - BY_NAME_ASC
          - BY_CREATE_TIME_ASC
          type: string
      - description: Starting point for listing, if you are fetching first page leave it empty
        in: query
        name: page_token
        required: false
        schema:
          default: ''
          type: string
      - description: Page size
        in: query
        name: page_size
        required: false
        schema:
          default: 20
          maximum: 100
          minimum: 1
          title: PageSize
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  properties:
                    apiVersion:
                      default: v2
                      description: "ApiVersion defines the versioned schema of this representation of an object.\n        Servers should convert recognized schemas to the latest internal value, and may reject\n        unrecognized values."
                      example: v2
                      readOnly: true
                      title: ApiVersion
                      type: string
                    kind:
                      default: ProjectSecret
                      description: "Kind is a string value representing the REST resource this object represents.\n        Servers may infer this from the endpoint the client submits requests to. Cannot be\n        updated. In CamelCase."
                      example: ProjectSecret
                      readOnly: true
                      title: Kind
                      type: string
                    metadata:
                      description: Metadata of the secret, all fields are read only
                      properties:
                        created_at:
                          description: Timestamp in ISO 8601 format
                          format: date-time
                          title: Timestamp
                          type: string
                        created_by:
                          properties:
                            id:
                              description: ID of a User
                              example: 18b40eaf-ce10-49c3-93f2-e4fe72d5160b
                              format: uuid
                              title: User.ID
                              type: string
                          title: User
                          type: object
                        description:
                          description: Description of the secret
                          type: string
                        id:
                          description: ID of a Secret
                          example: abbb5683-9310-49bb-9fd2-ac69486a4c6d
                          format: uuid
                          title: Secret.ID
                          type: string
                        last_used_at:
                          description: Last time the secret was used in a job
                          format: date-time
                          nullable: true
                          title: Timestamp
                          type: string
                        last_used_by:
                          description: Collected information about last usage of the secret
                          nullable: true
                          properties:
                            hook_id:
                              description: ID of a Hook
                              example: c0798875-7908-456b-ab3e-78de8247b6e0
                              format: uuid
                              title: Hook.ID
                              type: string
                            job_id:
                              description: ID of a Job
                              example: 7ce0901c-84b0-4bb4-ab96-f0a4b15ae52d
                              format: uuid
                              title: Job.ID
                              type: string
                            pipeline_id:
                              description: ID of a Pipeline
                              example: 4cd4fdb9-4248-4348-932c-855746110bcc
                              format: uuid
                              title: Pipeline.ID
                              type: string
                            project_id:
                              description: ID of a Project
                              example: 1c306e24-af58-4e95-8cd9-27e9a1a36428
                              format: uuid
                              title: Project.ID
                              type: string
                            user_id:
                              description: ID of a User
                              example: 7a8f94b1-c5b6-4195-82ca-f68664fa832b
                              format: uuid
                              title: User.ID
                              type: string
                            workflow_id:
                              description: ID of a Workflow
                              example: 40dcd7b2-3e42-4958-8c08-7eb5aa8690f6
                              format: uuid
                              title: Workflow.ID
                              type: string
                          title: Secrets.Checkout
                          type: object
                        name:
                          description: Secret name must match the regex
                          example: my-secret
                          minLength: 1
                          pattern: '^[@: -._a-zA-Z0-9]+$'
                          title: Secret.Name
                          type: string
                        org_id:
                          description: ID of a Organization
                          example: f0f54dbb-0f70-444f-ad99-773830e2428b
                          format: uuid
                          title: Organization.ID
                          type: string
                        project_id:
                          description: ID of a Project
                          example: afed5713-8c6e-4081-bdae-7030cebf24b6
                          format: uuid
                          title: Project.ID
                          type: string
                        updated_at:
                          description: Timestamp in ISO 8601 format
                          format: date-time
                          title: Timestamp
                          type: string
                        updated_by:
                          properties:
                            id:
                              description: ID of a User
                              example: 18b40eaf-ce10-49c3-93f2-e4fe72d5160b
                              format: uuid
                              title: User.ID
                              type: string
                          title: User
                          type: object
                      readOnly: true
                      required:
                      - id
                      - name
                      - org_id
                      - project_id
                      type: object
                    spec:
                      description: Specification of the secret
                      properties:
                        data:
                          description: Data of the secret, both env_vars and files are required but can be empty
                          properties:
                            env_vars:
                              description: Value of the secret
                              items:
                                description: Environment variable
                                properties:
                                  name:
                                    description: Name of the environment variable
                                    example: ENV_VAR_NAME
                                    minLength: 1
                                    type: string
                                  value:
                                    description: Value of the environment variable, or a md5 checksum
                                    type: string
                                required:
                                - name
                                - value
                                type: object
                              type: array
                            files:
                              description: Files of the secret
                              items:
                                description: File
                                properties:
                                  content:
                                    description: base64 encoded content of the file or a md5 checksum
                                    type: string
                                  path:
                                    description: Name of the file. Both absolute and relative paths are allowed.
                                    example: /path/to/file
                                    minLength: 1
                                    type: string
                                required:
                                - path
                      

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