Flatfile subpackage_secrets API

The subpackage_secrets API from Flatfile — 2 operation(s) for subpackage_secrets.

OpenAPI Specification

flatfile-subpackage-secrets-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: API Reference subpackage_accounts subpackage_secrets API
  version: 1.0.0
servers:
- url: https://api.x.flatfile.com/v1
tags:
- name: subpackage_secrets
paths:
  /secrets:
    get:
      operationId: list
      summary: List secrets
      description: Fetch all secrets for a given environmentId and optionally apply space overrides
      tags:
      - subpackage_secrets
      parameters:
      - name: environmentId
        in: query
        description: The Environment of the secret.
        required: false
        schema:
          $ref: '#/components/schemas/type_commons:EnvironmentId'
      - name: spaceId
        in: query
        description: The Space of the secret.
        required: false
        schema:
          $ref: '#/components/schemas/type_commons:SpaceId'
      - name: actorId
        in: query
        description: The Actor of the secret.
        required: false
        schema:
          $ref: '#/components/schemas/type_commons:ActorIdUnion'
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      - name: X-Disable-Hooks
        in: header
        required: true
        schema:
          type: string
          enum:
          - 'true'
      responses:
        '200':
          description: Response with status 200
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_secrets:SecretsResponse'
        '400':
          description: Error response with status 400
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:Errors'
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:Errors'
    post:
      operationId: upsert
      summary: Upsert a Secret
      description: Insert or Update a Secret by name for environment or space
      tags:
      - subpackage_secrets
      parameters:
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      - name: X-Disable-Hooks
        in: header
        required: true
        schema:
          type: string
          enum:
          - 'true'
      responses:
        '200':
          description: Response with status 200
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_secrets:SecretsResponse'
        '400':
          description: Error response with status 400
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:Errors'
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:Errors'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/type_secrets:WriteSecret'
  /secrets/{secretId}:
    delete:
      operationId: delete
      summary: Delete a secret by it's Id
      description: Deletes a specific Secret from the Environment or Space as is the case
      tags:
      - subpackage_secrets
      parameters:
      - name: secretId
        in: path
        description: The ID of the secret.
        required: true
        schema:
          $ref: '#/components/schemas/type_commons:SecretId'
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      - name: X-Disable-Hooks
        in: header
        required: true
        schema:
          type: string
          enum:
          - 'true'
      responses:
        '200':
          description: Response with status 200
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_secrets:SecretsResponse'
        '400':
          description: Error response with status 400
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:Errors'
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:Errors'
components:
  schemas:
    type_secrets:WriteSecret:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/type_secrets:SecretName'
          description: The reference name for a secret.
        value:
          $ref: '#/components/schemas/type_secrets:SecretValue'
          description: The secret value. This is hidden in the UI.
        environmentId:
          $ref: '#/components/schemas/type_commons:EnvironmentId'
          description: The Environment of the secret.
        spaceId:
          $ref: '#/components/schemas/type_commons:SpaceId'
          description: The Space of the secret.
        actorId:
          $ref: '#/components/schemas/type_commons:ActorIdUnion'
          description: The Actor of the secret.
      required:
      - name
      - value
      description: The properties required to write to a secret. Value is the only mutable property. Name, environmentId, spaceId (optional) are used for finding the secret.
      title: WriteSecret
    type_secrets:SecretValue:
      type: string
      description: The value of a secret. Minimum 1 character, maximum 1024
      title: SecretValue
    type_commons:UserId:
      type: string
      description: User ID
      title: UserId
    type_secrets:SecretName:
      type: string
      description: The name of a secret. Minimum 1 character, maximum 1024
      title: SecretName
    type_secrets:Secret:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/type_secrets:SecretName'
          description: The reference name for a secret.
        value:
          $ref: '#/components/schemas/type_secrets:SecretValue'
          description: The secret value. This is hidden in the UI.
        environmentId:
          $ref: '#/components/schemas/type_commons:EnvironmentId'
          description: The Environment of the secret.
        spaceId:
          $ref: '#/components/schemas/type_commons:SpaceId'
          description: The Space of the secret.
        actorId:
          $ref: '#/components/schemas/type_commons:ActorIdUnion'
          description: The Actor of the secret.
        id:
          $ref: '#/components/schemas/type_commons:SecretId'
          description: The ID of the secret.
      required:
      - name
      - value
      - id
      description: The value of a secret
      title: Secret
    type_commons:SecretId:
      type: string
      description: Secret ID
      title: SecretId
    type_secrets:SecretsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/type_secrets:Secret'
      required:
      - data
      title: SecretsResponse
    type_commons:GuestId:
      type: string
      description: Guest ID
      title: GuestId
    type_commons:Errors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/type_commons:Error'
      required:
      - errors
      title: Errors
    type_commons:EnvironmentId:
      type: string
      description: Environment ID
      title: EnvironmentId
    type_commons:Error:
      type: object
      properties:
        key:
          type: string
        message:
          type: string
      required:
      - message
      title: Error
    type_commons:ActorIdUnion:
      oneOf:
      - $ref: '#/components/schemas/type_commons:UserId'
      - $ref: '#/components/schemas/type_commons:AgentId'
      - $ref: '#/components/schemas/type_commons:GuestId'
      title: ActorIdUnion
    type_commons:SpaceId:
      type: string
      description: Space ID
      title: SpaceId
    type_commons:AgentId:
      type: string
      description: Agent ID
      title: AgentId
  securitySchemes:
    default:
      type: http
      scheme: bearer