Docs Navigation

Api v2 Teams

Stability: prototype

  1. List teams in an organization
  2. List all teams connected to project
  3. List teams for a secret
  4. Get a team
  5. Create a team in an organization
  6. Update a team
  7. Delete a team

List teams in an organization

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

[
  {
    "name": "developers",
    "permission": "edit",
    "description": "Developers team",
    "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
    "url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
    "users_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/users",
    "projects_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
    "secrets_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/secrets",
    "updated_at": "2017-06-10 16:59:51 +0200",
    "created_at": "2017-06-10 16:59:51 +0200"
  }
]

List all teams connected to project

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

[
  {
    "name": "developers",
    "permission": "edit",
    "description": "Developers team",
    "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
    "url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
    "users_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/users",
    "projects_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
    "secrets_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/secrets",
    "updated_at": "2017-06-10 16:59:51 +0200",
    "created_at": "2017-06-10 16:59:51 +0200"
  }
]

List teams for a secret

GET /secrets/{secret_id}/teams
Response
HTTP status: 200

[
  {
    "name": "developers",
    "permission": "edit",
    "description": "Developers team",
    "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
    "url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
    "users_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/users",
    "projects_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
    "secrets_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/secrets",
    "updated_at": "2017-06-10 16:59:51 +0200",
    "created_at": "2017-06-10 16:59:51 +0200"
  }
]

Get a team

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

{
  "name": "developers",
  "permission": "edit",
  "description": "Developers team",
  "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "users_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/users",
  "projects_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
  "secrets_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/secrets",
  "updated_at": "2017-06-10 16:59:51 +0200",
  "created_at": "2017-06-10 16:59:51 +0200"
}

Create a team in an organization

Only organization owners can create new teams.

POST /orgs/{org_username}/teams
Request
Name Type Description
name string Required. Name of the team. The name must be unique in the organization.
permission string Required. The permission level for team members in the organization.
one of: (read, edit, admin)
description string Description for the team.
Response
HTTP status: 200

{
  "name": "developers",
  "permission": "edit",
  "description": "Developers team",
  "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "users_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/users",
  "projects_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
  "secrets_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/secrets",
  "updated_at": "2017-06-10 16:59:51 +0200",
  "created_at": "2017-06-10 16:59:51 +0200"
}

Update a team

Only organization owners can update teams.

PATCH /teams/{id}
Request
Name Type Description
name string Name of the team. The name must be unique in the organization.
permission string The permission level for team members in the organization.
one of: (read, edit, admin)
description string Description for the team.
Response
HTTP status: 200

{
  "name": "developers",
  "permission": "edit",
  "description": "Developers team",
  "id": "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5",
  "users_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/users",
  "projects_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects",
  "secrets_url": "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/secrets",
  "updated_at": "2017-06-10 16:59:51 +0200",
  "created_at": "2017-06-10 16:59:51 +0200"
}

Delete a team

Only organization owners can delete teams.

DELETE /teams/{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.