Release API Reference

Use this API for programmatic access to channels and their supporting resources.

Endpoint

https://api.munchii.com/

Requests and responses bodies are application/json.

Authentication

Requests must include an Authorization header and access token:

Authorization: Bearer 8hb6t6myq5qypxezesox6q751o

Access tokens are:

  • secret — treat access tokens like a password
  • opaque — the length and format may change over time

You can test your access token with a command like:

curl -H 'Authorization: Bearer gi4dog1egmj37bh3rq58q93cnh' https://api.munchii.com/me

Sample Response:

{
  "data": {
    "owner": "fub8pmeeyer516tp3qk5iwzxwu"
  }
}

Concurrency Control

An ETag is used for optimistic concurrency control. GET responses return an ETag header for a single resource and ETag per resource in the response body for a resource collection. PUT, DELETE and PATCH methods must include an If-Match header in the request.

Channel Resource

A channel is a top-level resource.

List channels

Sample Request
GET /channels
Sample Response
HTTP 200
{
  "data": [
    {
    "name": "munchii.com-master"
    }
  ]
}

Create a channel

Sample Request

PUT /channels/<channel>

{
  "data": {
    "name": "munchii.com-master"
  }
}

NOTE: The channel name in the body and URL must match.

Sample Response

HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf

Describe a channel

Sample Request
GET /channels/<channel>
Sample Response

HTTP 200
ETag: 8e1hepnyfawwxswm3uofdryd9o

{
  "data": {
    "name": "munchii.com-master"
  },
  "state": {
      "latest": {
      "ordinal": "2"
    }
  }
}

Rename a channel

Sample Request

PUT /channels/<channel>
If-Match: 8e1hepnyfawwxswm3uofdryd9o

{
  "data": {
    "name": "munchii.com-master-v2"
  }
}

NOTE: Use the current name in the URL and specify the new name in the body.

Sample Response

HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf

Delete a channel

Only an empty channel (no targets) can be deleted.

Sample Request
DELETE /channels/<channel>
If-Match: 8e1hepnyfawwxswm3uofdryd9o
Sample Response

HTTP 204

Release Resource

A release is a sub-resource of a channel.

List releases

Releases are returned in reverse chronological order.

Sample Request
GET /channels/<channel>/releases
Sample Response
HTTP 200
{
  "data": [
    {
      "ordinal": "2"
    },
    {
      "ordinal": "1"
    }
  ]
}

Describe a release

Sample Request
GET /channels/<channel>/releases/<ordinal>
Sample Response
HTTP 200
Etag: 8e1hepnyfawwxswm3uofdryd9o
{
  "state": {
    "canceled": false
  }
}

Cancel a release

A canceled release will not be subsequently started by a target. Canceling a release does not interrupt a target that has already started the release.

Sample Request
PUT /channels/<channel>/releases/<ordinal>/canceled
If-Match: 8e1hepnyfawwxswm3uofdryd9o
Sample Response

HTTP 204
ETag: by1cqzmz16ftz7o8sfonf4efhf

Get upload release link

Returns a URL to PUT the next release. The URL is currently a pre-signed S3 link that is valid for 5 minutes. Use a PUT request with a Content-Length header to upload the next release. Exactly one release will be created for concurrent uploads (whichever upload completes first).

Sample Request
GET /channels/<channel>/releases/tail
Sample Response

HTTP 200

{
  "links": {
    "put": "https://..."
  }
}

Secret Resource

A secret is a sub-resource of a target.

List secrets

Sample Request

GET /channels/<channel>/targets/<target>/secrets

Sample Response

HTTP 200

{
  "data": [
    {
      "name": "SECRET_NAME_1"
    },
    {
      "name": "SECRET_NAME_2"
    }
  ]
}

Create or update a secret

Sample Request

PUT /channels/<channel>/targets/<target>/secrets/<secret>
If-Match: 8e1hepnyfawwxswm3uofdryd9o (Update)

{
  "data": {
    "name": "SECRET_NAME_3",
    "value: "plaintext secret"
  }
}

NOTE: The target name in the body and URL must match.

Sample Response

HTTP 201 (Create) or HTTP 204 (Update)
ETag: by1cqzmz16ftz7o8sfonf4efhf

Delete a secret

Sample Request

DELETE /channels/<channel>/targets/<target>/secrets/<secret>
If-Match: 8e1hepnyfawwxswm3uofdryd9o

Sample Response

HTTP 204

Target Resource

A target is a sub-resource of a channel.

Create a target

Sample Request

PUT /channels/<channel>/targets/<target>

{
  "data": {
    "name": "test"
  }
}

NOTE: The target name in the body and URL must match.

Sample Response

HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf

Describe a target

Sample Request
GET/channels/<channel>/targets/<target>
Sample Response

HTTP 200
ETag: 8e1hepnyfawwxswm3uofdryd9o

{
  "data": {
    "name": "test"
  },
  "state": {
    "latest": {
      "ordinal": "2",
      "status": "executing"
    }
  }
}

NOTE: A target’s state is read-only and cannot be directly modified.

Get latest attempt log

Sample Request
GET/channels/<channel>/targets/<target>/logs
Sample Response

HTTP 200

{
"data": {
"tail": [
"most recent",
"..."
]
}

Rename a target

Sample Request

PATCH /channels/<channel>/targets/<target>
If-Match: 8e1hepnyfawwxswm3uofdryd9o

{
  "data": {
    "name": "prod-bug-fix"
  }
}

NOTE: Use the current name in the URL and specify the new name in the body.

Sample Response

HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf

Delete a target

Sample Request
DELETE /channels/<channel>/targets/<target>
If-Match: 8e1hepnyfawwxswm3uofdryd9o
Sample Response

HTTP 204

Retry a target

Retry a failed release.

Sample Request
POST/channels/<channel>/targets/<target>/retries
If-Match: 8e1hepnyfawwxswm3uofdryd9o
Sample Response

HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf

Interrupt a target

Stop the executing release.

Sample Request
POST/channels/<channel>/targets/<target>/interrupts
If-Match: 8e1hepnyfawwxswm3uofdryd9o
Sample Response

HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf

Bypass a target

Mark a failed release as complete so that dependent targets can start it.

Sample Request
POST/channels/<channel>/targets/<target>/bypasses
If-Match: 8e1hepnyfawwxswm3uofdryd9o
Sample Response

HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf

Topology Resource

A topology is a sub-resource of a channel. It uses a directed graph of targets that describes how to schedule releases.

Describe the topology

Sample Request
GET /channels/<channel>/topology
Sample Response

HTTP 200
ETag: 8e1hepnyfawwxswm3uofdryd9o

{
  "data": [
    {
      "name": "test",
      "after": []
    },
    {
      "name": "prod",
      "after": [
        "test"
      ]
    }
  ]
}

Update the topology

Sample Request

PUT /channels/<channel>/topology
If-Match: 8e1hepnyfawwxswm3uofdryd9o

{
  "data": [
    {
      "name": "test",
      "after": []
    },
    {
      "name": "prod",
      "after": [
        "test"
      ]
    }
  ]
}

NOTE: Targets can only be rearranged — use the target resource to create and delete targets.

Sample Response

HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf