Docs Navigation

Api v2 Shared Configurations

Stability: prototype

  1. List shared configurations in an organization
  2. List shared configurations in a team
  3. List shared configurations attached to a project
  4. Get a shared configuration
  5. Create shared configuration in an organization
  6. Update a shared configuration
  7. Delete a shared configuration
  8. Add a shared configuration to a team
  9. Attach a shared configuration to a project
  10. Remove shared configuration from a team
  11. Dettach a shared configuration from a project

List shared configurations in an organization

GET /orgs/{org_username}/shared_configs
Response
HTTP status: 200

[
  {
    "description": "AWS tokens for deployment",
    "projects_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
    "teams_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/teams",
    "name": "AWS Tokens",
    "config_files_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/config_files",
    "updated_at": "2017-06-10 16:59:51 +0200",
    "env_vars_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/env_vars",
    "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
    "url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
    "created_at": "2017-06-10 16:59:51 +0200"
  }
]

List shared configurations in a team

GET /teams/{team_id}/shared_configs
Response
HTTP status: 200

[
  {
    "description": "AWS tokens for deployment",
    "projects_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
    "teams_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/teams",
    "name": "AWS Tokens",
    "config_files_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/config_files",
    "updated_at": "2017-06-10 16:59:51 +0200",
    "env_vars_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/env_vars",
    "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
    "url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
    "created_at": "2017-06-10 16:59:51 +0200"
  }
]

List shared configurations attached to a project

GET /projects/{project_id}/shared_configs
Response
HTTP status: 200

[
  {
    "description": "AWS tokens for deployment",
    "projects_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
    "teams_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/teams",
    "name": "AWS Tokens",
    "config_files_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/config_files",
    "updated_at": "2017-06-10 16:59:51 +0200",
    "env_vars_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/env_vars",
    "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
    "url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
    "created_at": "2017-06-10 16:59:51 +0200"
  }
]

Get a shared configuration

GET /shared_configs/{id}
Response
HTTP status: 200

{
  "description": "AWS tokens for deployment",
  "projects_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
  "teams_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/teams",
  "name": "AWS Tokens",
  "config_files_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/config_files",
  "updated_at": "2017-06-10 16:59:51 +0200",
  "env_vars_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/env_vars",
  "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "created_at": "2017-06-10 16:59:51 +0200"
}

Create shared configuration in an organization

POST /orgs/{org_username}/shared_configs
Request
Name Type Description
name string Required. Name of the shared configuration.
description string Description for the shared configuration.
Response
HTTP status: 200

{
  "description": "AWS tokens for deployment",
  "projects_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
  "teams_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/teams",
  "name": "AWS Tokens",
  "config_files_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/config_files",
  "updated_at": "2017-06-10 16:59:51 +0200",
  "env_vars_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/env_vars",
  "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "created_at": "2017-06-10 16:59:51 +0200"
}

Update a shared configuration

To update the shared configuration you need to be an admin or owner in your organization.

PATCH /shared_configs/{id}
Request
Name Type Description
name string Name of the shared configuration.
description string Description for the shared configuration.
Response
HTTP status: 200

{
  "description": "AWS tokens for deployment",
  "projects_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
  "teams_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/teams",
  "name": "AWS Tokens",
  "config_files_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/config_files",
  "updated_at": "2017-06-10 16:59:51 +0200",
  "env_vars_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/env_vars",
  "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "created_at": "2017-06-10 16:59:51 +0200"
}

Delete a shared configuration

Deleting a shared configuration requires at least admin permissions in the organization.

DELETE /shared_configs/{id}
Response
HTTP status: 204

Add a shared configuration to a team

The user needs to be a member of the team, and to have admin permissions in the organization.

POST /teams/{team_id}/shared_configs/{shared_config_id}
Response
HTTP status: 204

Attach a shared configuration to a project

POST /projects/{project_id}/shared_configs/{shared_config_id}
Response
HTTP status: 200

{
  "description": "AWS tokens for deployment",
  "projects_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
  "teams_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/teams",
  "name": "AWS Tokens",
  "config_files_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/config_files",
  "updated_at": "2017-06-10 16:59:51 +0200",
  "env_vars_url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/env_vars",
  "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "url": "https://api.semaphoreci.com/v2/shared_configs/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "created_at": "2017-06-10 16:59:51 +0200"
}

Remove shared configuration from a team

The user needs to be a member of the team, and to have admin permissions in the organization.

DELETE /teams/{team_id}/shared_configs/{shared_config_id}
Response
HTTP status: 204

Dettach a shared configuration from a project

DELETE /projects/{project_id}/shared_configs/{shared_config_id}
Response
HTTP status: 204

Semaphore Docs are open source — Edit on GitHub

Newsletter

Occasional lightweight product and blog updates. Unsubscribe at any time.

2009-2017 © Rendered Text. All rights reserved. Terms of Service, Privacy policy, Security.