Use this API for programmatic access to channels and their supporting resources.
https://api.munchii.com/
Requests and responses bodies are application/json
.
Requests must include an Authorization
header and access token:
Authorization: Bearer 8hb6t6myq5qypxezesox6q751o
Access tokens are:
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"
}
}
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.
A channel is a top-level resource.
/channels
{
"data": [
{
"name": "munchii.com-master"
}
]
}
PUT /channels/<channel>
{
"data": {
"name": "munchii.com-master"
}
}
NOTE: The channel name in the body and URL must match.
HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf
/channels/<channel>
HTTP 200
ETag: 8e1hepnyfawwxswm3uofdryd9o
{
"data": {
"name": "munchii.com-master"
},
"state": {
"latest": {
"ordinal": "2"
}
}
}
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.
HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf
Only an empty channel (no targets) can be deleted.
/channels/<channel>
HTTP 204
A release is a sub-resource of a channel.
Releases are returned in reverse chronological order.
/channels/<channel>/releases
{
"data": [
{
"ordinal": "2"
},
{
"ordinal": "1"
}
]
}
/channels/<channel>/releases/<ordinal>
{
"state": {
"canceled": false
}
}
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.
/channels/<channel>/releases/<ordinal>/canceled
HTTP 204
ETag: by1cqzmz16ftz7o8sfonf4efhf
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).
/channels/<channel>/releases/tail
HTTP 200
{
"links": {
"put": "https://..."
}
}
A secret is a sub-resource of a target.
GET
/channels/<channel>/targets/<target>/secrets
HTTP 200
{
"data": [
{
"name": "SECRET_NAME_1"
},
{
"name": "SECRET_NAME_2"
}
]
}
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.
HTTP 201 (Create) or HTTP
204 (Update)
ETag: by1cqzmz16ftz7o8sfonf4efhf
DELETE
/channels/<channel>/targets/<target>/secrets/<secret>
If-Match: 8e1hepnyfawwxswm3uofdryd9o
HTTP 204
A target is a sub-resource of a channel.
PUT /channels/<channel>/targets/<target>
{
"data": {
"name": "test"
}
}
NOTE: The target name in the body and URL must match.
HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf
/channels/<channel>/targets/<target>
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.
/channels/<channel>/targets/<target>/logs
HTTP 200
{
"data": {
"tail": [
"most recent",
"..."
]
}
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.
HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf
/channels/<channel>/targets/<target>
HTTP 204
Retry a failed release.
/channels/<channel>/targets/<target>/retries
HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf
Stop the executing release.
/channels/<channel>/targets/<target>/interrupts
HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf
Mark a failed release as complete so that dependent targets can start it.
/channels/<channel>/targets/<target>/bypasses
HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf
A topology is a sub-resource of a channel. It uses a directed graph of targets that describes how to schedule releases.
/channels/<channel>/topology
HTTP 200
ETag: 8e1hepnyfawwxswm3uofdryd9o
{
"data": [
{
"name": "test",
"after": []
},
{
"name": "prod",
"after": [
"test"
]
}
]
}
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.
HTTP 201
ETag: by1cqzmz16ftz7o8sfonf4efhf