Zeplin Variable Collections API

The Variable Collections API from Zeplin — 2 operation(s) for variable collections.

OpenAPI Specification

zeplin-variable-collections-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: Zeplin Authorization Variable Collections API
  description: Access your resources in Zeplin
  version: 1.38.0
  contact:
    name: Zeplin
    url: https://zeplin.io
    email: support@zeplin.io
servers:
- url: https://api.zeplin.dev
security:
- PersonalAccessToken: []
- OAuth2: []
tags:
- name: Variable Collections
paths:
  /v1/projects/{project_id}/variable_collections:
    get:
      tags:
      - Variable Collections
      summary: Get project variable collections
      description: 'This endpoint returns all of the color variables in a project


        You need to be a member of the project or a member of the organization that owns the project. Returns `Not Found` response otherwise.

        '
      operationId: GetProjectVariableCollections
      parameters:
      - $ref: '#/components/parameters/project_id'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/include_linked_styleguides'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VariableCollection'
              examples:
                Project Variable Collections:
                  value:
                  - $ref: '#/components/examples/variableCollection/value'
        '404':
          $ref: '#/components/responses/projectNotFound'
        '422':
          $ref: '#/components/responses/projectArchived'
  /v1/styleguides/{styleguide_id}/variable_collections:
    get:
      tags:
      - Variable Collections
      summary: Get styleguide variable collections
      description: 'This endpoint returns all of the color variables in a styleguide


        You need to be a member of the styleguide or a member of the organization that owns the styleguide. Returns `Not Found` response otherwise.

        '
      operationId: GetStyleguideVariableCollections
      parameters:
      - $ref: '#/components/parameters/styleguide_id'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/include_linked_styleguides'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VariableCollection'
              examples:
                Styleguide Variable Collections:
                  value:
                  - $ref: '#/components/examples/variableCollection/value'
        '404':
          $ref: '#/components/responses/styleguideNotFound'
        '422':
          $ref: '#/components/responses/styleguideArchived'
components:
  schemas:
    VariableValueTypeEnum:
      title: Source
      type: string
      description: Variable value types
      enum:
      - color
    ResourceProjectSource:
      title: Source Project
      type: object
      description: The source project of the resource
      required:
      - id
      - name
      - platform
      properties:
        id:
          type: string
          description: The unique id of the source project
        name:
          type: string
          description: The name of the source project
        platform:
          type: string
          enum:
          - web
          - ios
          - android
          - macos
          description: The target platform of the source project
        linked_styleguide:
          $ref: '#/components/schemas/EntityReference'
          description: Reference of the styleguide which the source project is linked to
      example:
        $ref: '#/components/examples/resourceProjectSource'
    Variable:
      title: Variable
      type: object
      required:
      - id
      - name
      - source_id
      - values
      properties:
        id:
          type: string
          description: The unique id of the variable
        name:
          type: string
          description: The name of the variable
        description:
          type: string
          description: The description of the variable
        source_id:
          type: string
          description: Variable's identifier in the design tool
        values:
          type: array
          items:
            $ref: '#/components/schemas/VariableValue'
      example:
        $ref: '#/components/examples/variable'
    EntityReference:
      title: Object Reference
      type: object
      required:
      - id
      properties:
        id:
          type: string
          description: Id of the entity
      example:
        $ref: '#/components/examples/entityReference'
    ColorData:
      title: Color Data
      type: object
      required:
      - r
      - g
      - b
      - a
      properties:
        source_id:
          type: string
          description: Color's identifier in the design tool
        r:
          type: integer
          description: Red component of the color
        g:
          type: integer
          description: Green component of the color
        b:
          type: integer
          description: Blue component of the color
        a:
          type: number
          description: Alpha component of the color
      example:
        $ref: '#/components/examples/colorData'
    VariableCollection:
      title: Variable Collection
      type: object
      required:
      - id
      - created
      - name
      - modes
      - groups
      - source_id
      properties:
        id:
          type: string
          description: The unique id of the variable collection
        created:
          type: integer
          format: timestamp
          description: The unix timestamp when the variable collection was created
        name:
          type: string
          description: The name of the variable collection
        description:
          type: string
          description: The description of the variable collection
        modes:
          type: array
          items:
            $ref: '#/components/schemas/VariableMode'
        groups:
          type: array
          items:
            $ref: '#/components/schemas/VariableGroup'
        source_id:
          type: string
          description: Variable collection's identifier in the design tool
        source:
          $ref: '#/components/schemas/ResourceSource'
          description: Source of the variable collection - either `project` or `styleguide`.
      example:
        $ref: '#/components/examples/variableCollection'
    ErrorResponse:
      title: Error Response
      type: object
      required:
      - message
      properties:
        message:
          type: string
          description: A user readable descriptive message for the error
        detail:
          type: string
          description: A detailed message describing the error
        code:
          type: string
          description: The unique code for the error
      example:
        $ref: '#/components/examples/error'
    VariableGroup:
      title: Variable Group
      type: object
      required:
      - id
      - name
      - variables
      properties:
        id:
          type: string
          description: Identifier of the color
        name:
          type: string
          description: Name of the color
        description:
          type: string
          description: Description of the color
        parent:
          type: string
          description: Parent group of the group
        variables:
          type: array
          items:
            $ref: '#/components/schemas/Variable'
      example:
        $ref: '#/components/examples/variableGroup'
    ResourceSource:
      title: Resource Source
      type: object
      description: Source details for resource. It has to be either `project` or `styleguide`.
      properties:
        project:
          $ref: '#/components/schemas/ResourceProjectSource'
        styleguide:
          $ref: '#/components/schemas/ResourceStyleguideSource'
      example:
        $ref: '#/components/examples/resourceSourceForProject'
      x-examples:
        Project:
          $ref: '#/components/examples/resourceSourceForProject'
        Styleguide:
          $ref: '#/components/examples/resourceSourceForStyleguide'
    VariableMode:
      title: Variable Mode
      type: object
      required:
      - id
      - name
      - mode_id
      properties:
        id:
          type: string
          description: Identifier of the mode
        name:
          type: string
          description: Name of the mode
        mode_id:
          type: string
          description: Mode's identifier in the design tool
      example:
        $ref: '#/components/examples/variableMode'
    VariableValue:
      title: Variable value
      type: object
      required:
      - mode_id
      - type
      - color
      properties:
        mode_id:
          type: string
          description: Mode id of the variable value
        type:
          $ref: '#/components/schemas/VariableValueTypeEnum'
          description: Type of the variable value
        color:
          $ref: '#/components/schemas/ColorData'
          description: Color value of the variable
      example:
        $ref: '#/components/examples/variableValue'
    ResourceStyleguideSource:
      title: Source Styleguide
      type: object
      description: The source styleguide of the resource
      required:
      - id
      - name
      - platform
      properties:
        id:
          type: string
          description: The unique id of the source styleguide
        name:
          type: string
          description: The name of the source styleguide
        platform:
          type: string
          enum:
          - base
          - web
          - ios
          - android
          - macos
          description: The target platform of the source styleguide
        parent:
          $ref: '#/components/schemas/EntityReference'
          description: Reference of the parent styleguide of the source styleguide
      example:
        $ref: '#/components/examples/resourceStyleguideSource'
  examples:
    resourceSourceForStyleguide:
      summary: Source for Styleguide
      value:
        styleguide:
          $ref: '#/components/examples/resourceStyleguideSource/value'
    resourceStyleguideSource:
      summary: Source Styleguide
      value:
        id: 5db981be9df2b3e1bfa19ef2
        name: Discovery 1
        platform: web
        parent:
          id: 5db981be9df2b3e1bfa19ef2
    resourceSourceForProject:
      summary: Source for Project
      value:
        project:
          $ref: '#/components/examples/resourceProjectSource/value'
    resourceProjectSource:
      summary: Source Project
      value:
        id: 5db81e73e1e36ee19f138c1a
        name: HAL 9000
        platform: web
        linked_styleguide:
          id: 5db981be9df2b3e1bfa19ef2
    colorData:
      summary: Color Data
      value:
        source_id: 0BEBFEB3-A107-4D1D-A3B0-77D1FBD35F01
        r: 143
        g: 152
        b: 5
        a: 1
    variableGroup:
      summary: Variable Group
      value:
        id: 666062f07fe9b31970400139
        name: default
        variables:
        - $ref: '#/components/examples/variable/value'
    variableCollection:
      summary: Variable Collection
      value:
        id: 6662b9998f1d57de4566e868
        created: 1717746073
        name: Fundamentals
        source_id: 4ba9866092495c104742f0959edbaa8bfa35e483
        modes:
          $ref: '#/components/examples/variableMode'
        groups:
          $ref: '#/components/examples/variableGroup'
    variableValue:
      summary: Variable value
      value:
        mode_id: 666062f07fe9b31970400138
        type: color
        color:
          r: 0
          g: 0
          b: 0
          a: 1
    variable:
      summary: Variable
      value:
        id: 666062f07fe9b3197040013e
        name: Black
        source_id: d36cffd7c2da067c567ecc4ece9ad5fafff6ec7c
        values:
        - $ref: '#/components/examples/variableValue/value'
    error:
      summary: Error
      value:
        message: Project is not found
    variableMode:
      summary: Variable Mode
      value:
        id: 666062f07fe9b31970400138
        name: Mode 1
        mode_id: 4140
    entityReference:
      summary: Object Reference
      value:
        id: 5dbad85a76ea51c1f35b6f69
  responses:
    styleguideArchived:
      description: Styleguide archived response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            Styleguide archived response:
              value:
                message: Styleguide is archived
    styleguideNotFound:
      description: Styleguide not found response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            Styleguide not found response:
              value:
                message: Styleguide not found
    projectNotFound:
      description: Project not found response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            Project not found response:
              value:
                message: Project not found
    projectArchived:
      description: Project archived response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            Project archived response:
              value:
                message: Project is archived
  parameters:
    limit:
      name: limit
      in: query
      description: Pagination limit
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 30
    offset:
      name: offset
      in: query
      description: Pagination offset
      required: false
      schema:
        type: integer
        minimum: 0
        default: 0
    project_id:
      name: project_id
      in: path
      description: Project id
      required: true
      schema:
        type: string
        pattern: /^[0-9a-f]{24}$/i
    include_linked_styleguides:
      name: include_linked_styleguides
      in: query
      description: Whether to include linked styleguides or not
      required: false
      schema:
        type: boolean
        default: false
    styleguide_id:
      name: styleguide_id
      in: path
      description: Styleguide id
      required: true
      schema:
        type: string
        pattern: /^[0-9a-f]{24}$/i
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: /v1/oauth/authorize
          tokenUrl: /v1/oauth/token
          refreshUrl: /v1/oauth/token
          scopes: {}
    PersonalAccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT