Environments

The Environments API allows you to access deployment environments created on your account.

Get an environment

GET

/environments/:environmentid

Example request with cURL

curl "https://yoursubdomain.deploybot.com/api/v1/environments/42" \
  -X GET \
  -H "X-Api-Token: api-token"

Response

id integer ID of environment
name string Name of environment
current_version string Last deployed version
is_automatic boolean A flag indicating whether environment is deployed automatically
repository_id string ID of repository
branch_name string Name of deployed branch
deploy_webhook_url string URL that will trigger deployment to that environment
status_badge_png_url string URL for the PNG version of environment status badge
status_badge_svg_url string URL for the SVG version of environment status badge
created_at string Creation timestamp
updated_at string Last update timestamp

Example response

HTTP/1.1 200 OK
Content-Type: application/json
{ 
  "id": 1,
  "name": "Test",
  "current_version": "3d6c203d89b526f14ebf17e8282b616572c583a9",
  "is_automatic": false,
  "repository_id": "1",
  "branch_name": "master",
  "deploy_webhook_url": "https://support.deploybot.com/webhook/deploy?env_id=1\u0026secret=qwerty",
  "status_badge_png_url": "https://support.deploybot.com/badge/13023223918096/1.png",
  "status_badge_svg_url": "https://support.deploybot.com/badge/13023223918096/1.svg",
  "created_at": "2015/02/24 15:22:49 +0000",
  "updated_at": "2015/02/24 15:27:07 +0000"
}

List environments

Querystring parameters

repository_id ID of repository to filter results by
limit Max number of environments to return per request (default 50, max 50)
after ID of last environment returned by previous request. Used for paging results.
GET

/environments

Example request with cURL

curl "https://yoursubdomain.deploybot.com/api/v1/environments?limit=2&after=42" \
  -X GET \
  -H "X-Api-Token: api-token"

Response

meta object
meta/next integer Next page’s after parameter’s value
meta/next_uri string Next page’s URI when the query results do not fit on a single page
meta/total integer Total number of environments
entries array List of environments matching the query
entries/id integer ID of environment
entries/name string Name of environment
entries/current_version string Last deployed version
entries/is_automatic boolean A flag indicating whether environment is deployed automatically
entries/repository_id string ID of repository
entries/branch_name string Name of deployed branch
entries/deploy_webhook_url string URL that will trigger deployment to that environment
entries/status_badge_png_url string URL for the PNG version of environment status badge
entries/status_badge_svg_url string URL for the SVG version of environment status badge
entries/created_at string Creation timestamp
entries/updated_at string Last update timestamp

Example response

HTTP/1.1 200 OK
Content-Type: application/json
{ 
  "meta": {
    "next": 48,
    "next_uri": "/environments?after=48&limit=2",
    "total": 3
  },
  "entries": [
    {
      "id": 43,
      "name": "Test",
      "current_version": "3d6c203d89b526f14ebf17e8282b616572c583a9",
      "is_automatic": false,
      "repository_id": "1",
      "branch_name": "master",
      "deploy_webhook_url": "https://support.deploybot.com/webhook/deploy?env_id=43\u0026secret=qwerty",
      "status_badge_png_url": "https://support.deploybot.com/badge/13023223918096/1.png",
      "status_badge_svg_url": "https://support.deploybot.com/badge/13023223918098/1.svg",
      "created_at": "2015/02/24 13:32:48 +0000",
      "updated_at": "2015/02/24 14:37:09 +0000"
    }
  ]
}