Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Create a Package

POST /v3/apps/:guid/packages

Request

Route

POST /v3/apps/guid-dd4e1ad7-7317-481e-963d-3b873d45885f/packages

Body

Name Description Parameter Type Default Valid Values Example Values
type Package type String
  • bits
  • docker
data Data for docker packages. Can be empty for bits packages.
data["image"] Location of docker image. Required for docker packages. String
  • registry/image:latest
{
  "type": "docker",
  "data": {
    "image": "registry/image:latest"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1NyIsImVtYWlsIjoiZW1haWwtOTdAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1ODg1NTY2OX0.2P8VlyjucdnskY_foWiNl-NCaSJCzXU34MhtDt1hlk0
Content-Type: application/json
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-dd4e1ad7-7317-481e-963d-3b873d45885f/packages" -d '{
  "type": "docker",
  "data": {
    "image": "registry/image:latest"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1NyIsImVtYWlsIjoiZW1haWwtOTdAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1ODg1NTY2OX0.2P8VlyjucdnskY_foWiNl-NCaSJCzXU34MhtDt1hlk0" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "27e8f683-cf13-447b-84ed-ed65d155568e",
  "type": "docker",
  "data": {
    "image": "registry/image:latest"
  },
  "state": "READY",
  "created_at": "2016-03-17T21:41:09Z",
  "updated_at": null,
  "links": {
    "self": {
      "href": "/v3/packages/27e8f683-cf13-447b-84ed-ed65d155568e"
    },
    "stage": {
      "href": "/v3/packages/27e8f683-cf13-447b-84ed-ed65d155568e/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-dd4e1ad7-7317-481e-963d-3b873d45885f"
    }
  }
}

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: application/json; charset=utf-8
X-Runtime: 0.024131
Content-Length: 520