The Wayback Machine - https://web.archive.org/web/20150926202327/https://www.packet.net/dev/api/
 Back to top

This is the API for Packet. Interact with your devices, user account, and projects.

Next 

Versioning 

Requesting a specific version of a resource from the Packet API is done via the Accept header:

curl -H 'Accept: application/json; version=1'

Alternatively, if your client doesn’t support setting headers (or if you’re quickly experimenting), you can set the API version with a parameter in the URL, though the Accept header is the preferred method:

curl https://api.packet.net?version=1
Next  Previous

Authentication 

Most of the endpoints in the Packet API require authentication. Authenticating is done with an authentication token in the X-Auth-Token header.

curl -H 'X-Auth-Token: my_authentication_token' https://api.packet.net

Authentication tokens are used to identify the user your application is connecting to the Packet API on behalf of. Think of authentication tokens as permanent sessions—the user creates authentication tokens, and your app can use them to connect to the Packet API on their behalf until they delete the token.

Users can create authentication tokens in the Packet Portal.

Next  Previous

Media Types 

Generally speaking, the Packet API supports JSON (application/json) only.

curl -H 'Accept: application/json' https://api.packet.net

Some routes may support other media types where appropriate.

Requests that require data to be submitted to the API (POST, PUT and PATCH) may include the data in the request body (if the Content-Type header is set to application/json) or as form-encoded data.

curl -H "Content-Type: application/json" -d '{"param":"value"}' https://api.packet.net/devices
# or
curl -d 'param=value' https://api.packet.net/devices
Next  Previous

Common Parameters 

The Packet API uses a few methods to minimize network traffic and bandwidth:

include

For resources that contain collections of other resources, the Packet API will return links to the other resources by default.

{
  ...
  // Includes "href" links if the resource is reachable through the API.
  "projects": [
    { "href": "https://api.packet.net/projects/5b590e4f-be96-4400-ae32-c315ee67964d" },
    { "href": "https://api.packet.net/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd" }
  ],
  // Includes "id" attributes if not.
  "emails": [
    { "id": "eb5d8c89-4d15-4c87-859c-5ae190ad5d9a" },
    { "id": "c17f77ad-9070-4084-abaa-7538581d9523" }
  ]
  ...
}

However, if you’re interested in acting on resources in the projects collection, it doesn’t make sense to make a separate API call to retrieve each project. Instead, you can specify which collections you’d like to be included using the include parameter.

/user?include=projects

will return

{
  ...
  "projects": [
    {
      "href": "https://api.packet.net/projects/c851d3c5-d55d-4b1a-99f1-96fc64768bc3",
      "id": "c851d3c5-d55d-4b1a-99f1-96fc64768bc3",
      "name": "Project 1",
      ...
    },
    {
      "href": "https://api.packet.net/projects/21f8e88b-bd4e-44ca-b956-4f3f88e6e5f2",
      "id": "21f8e88b-bd4e-44ca-b956-4f3f88e6e5f2",
      "name": "Project 2",
      ...
    }
  ],
  ...
}

The include parameter is accepted for all GET requests on all resources and collections, and should be specified as a comma-separated list.

/user?include=emails,projects,memberships

You may also include nested associations up to 3 levels deep using dot notation:

/user?include=memberships.projects
Next  Previous

Errors 

The common HTTP Response Status Codes are used. You know the drill.

For 400-family status codes, the response body will contain an array of errors.

Next  Previous

Devices 

Devices are the heart of the Packet ecosystem.

Devices 

A collection of devices for a given project.

Retrieve all Devices
/projects/{id}/devices

Returns a list of the current projects’s devices.

  • Response  200
  • Body
    {
      "devices": [
        { "href": "https://api.packet.net/devices/8f10d92c-3c0b-4df4-a9e1-c9fb8ce1a79a" },
        { "href": "https://api.packet.net/devices/73895ed2-d6c6-4229-bb67-ae3143d64148" },
        ...
      ]
    }
    
Create a Device
/projects/{id}/devices

Creates a new device and provisions it in our datacenter.

Type-specific options (such as operating_system for baremetal devices) should be included in the main data structure alongside hostname and plan.

  • Request
  • Body
    {
      "hostname": "web1.example.com",
      "plan": "baremetal_1",
      "billing_cycle": "hourly",
      "facility": "ewr1",
      "operating_system": "coreos_stable",
      "locked": true,
      "userdata": "---\nruncmd:\n  - [ ls, -l, / ]",
      "tags": ["database"]
    }
    
  • Response  201
  • Headers
    Location: https://api.packet.net/devices/1acd244d-5abe-4992-bb63-135a032a001f rel="self"
    Body
    {
      "href": "https://api.packet.net/devices/1acd244d-5abe-4992-bb63-135a032a001f"
    }
    

Device 

A single device object.

Retrieve a Device
/devices/{id}

Type-specific options (such as facility for baremetal devices) will be included as part of the main data structure.

  • Parameters
  • id
    string (required) 

    The device ID in the form of a UUID.

  • Response  200
  • Body
    {
      "id": "c8109e92-ae6c-4134-8fd9-8d86a702e7c3",
      "plan": {
        "id": "d3ceef7e-e87d-44d6-a4cb-5571f4f4cd8a"
      },
      "billing_cycle": "daily",
      "hostname": "web1.example.com",
      "state": "active",
      "locked": true,
      "userdata": "---\nruncmd:\n  - [ ls, -l, / ]",
      "tags": ["database", "app"],
      "operating_system": {
        "slug": "coreos_stable",
        "name": "CoreOS (Stable)",
        "distro": "coreos",
        "version": "stable"
      },
      "ip_addresses": [
        { "address": "2.3.4.5", "address_family": 4, "public": true },
        { "address": "10.0.0.0", "address_family": 4, "public": false },
        { "address": "2604:1380::1", "address_family": 6, "public": true }
      ],
      "project": {
        "href": "https://api.packet.net/projects/0a315aa2-4513-4780-9093-4d1af8400a7b"
      },
      "created_at": "2014-04-14T02:15:15Z",
      "updated_at": "2014-04-15T02:15:15Z",
      "href": "https://api.packet.net/devices/c8109e92-ae6c-4134-8fd9-8d86a702e7c3"
    }
    
Update a Device
/devices/{id}
  • Parameters
  • id
    string (required) 

    The device ID in the form of a UUID.

  • Request
  • Body
    {
      "hostname": "web2.example.com"
    }
    
  • Response  204
Delete a Device
/devices/{id}

Deletes a device and deprovisions it in our datacenter.

  • Parameters
  • id
    string (required) 

    The device ID in the form of a UUID.

  • Response  204

Actions 

A collection of actions for a given device.

Create an Action
/devices/{id}/actions

Creates an action for the given device. Possible actions include:

  • power_on

  • power_off

  • reboot

  • rebuild

  • Parameters
  • id
    string (required) 

    The device ID to retrieve actions for.

  • Request
  • Body
    {
      "type": "power_on"
    }
    
  • Response  202

Events 

Provides a list of events pertaining to a specific device.

List a device's events
/devices/{id}/events
  • Parameters
  • id
    string (required) 

    The device ID in the form of a UUID.

  • Response  200
  • Body
    {
      "events": [
        {
          "id": "55499ca6-5b65-4fca-b7b1-acdb48e19bf5",
          "type": "provisioning.109",
          "body": "Installation finished, restarting device",
          "created_at": "2015-03-10T15:54:54Z",
          "relationships": [
            {
              "id": "30d7377e-fe7f-4ee8-8394-d9440a37a68e"
            }
          ],
          "interpolated": "Installation finished, restarting device",
          "href": "/events/55499ca6-5b65-4fca-b7b1-acdb48e19bf5"
        },
        ...
      ]
    }
    

Locations 

Provides a listing of available datacenters where you can provision Packet devices.

List available locations
/facilities
  • Response  200
  • Body
    {
      "facilities": [
        {
          "id": "6dde1d2e-1c62-4647-b990-14d929aa1797",
          "name": "Parsippany, NJ",
          "code": "ewr1",
          "address": "200 Webro Road",
          "city": "Parsippany",
          "state": "NJ",
          "country": "United States",
          "coordinates": { "latitude": 40.857084, "longitude": -74.418907 },
          "features": [ "baremetal" ]
        },
        ...
      ]
    }
    

Operating systems 

Provides a listing of available operating systems to provision your new device with.

List available OSes
/operating-systems
  • Response  200
  • Body
    {
      "oses": [
        { "slug": "ubuntu_14_04", "name": "Ubuntu 14.04", "distro": "ubuntu", "version": 14.04 },
        { "slug": "coreos_stable", "name": "CoreOS (stable)", "distro": "coreos", "version": "stable" },
        ...
      ]
    }
    

Plans 

Provides a listing of available services plans available to provision your device on.

List available Plans
/plans
  • Response  200
  • Body
    {
      "plans": [
        {
          "slug": "baremetal_1",
          "name": "Type 1",
          "id": "6d1f1ffa-7912-4b78-b50d-88cc7c8ab40f",
          "description": "Our Type 1 configuration ...",
          "pricing": { "hourly": 0.4 },
          "line": "baremetal",
          "specs": {
            "nics": [{ "count": 2, "type": "gigabit" }],
            "drives": [{ "count": 2, "type": "SSD", "size": "120GB" }],
            "features": { "txt": true, "raid": true},
            "cpus": [{ "count": 1, "type": "Intel E3-1240 v3" }],
            "memory": { "total": "16GB" }
          }
        },
        ...
      ]
    }
    

Projects 

A collection of projects that the current user is a member of.

Retrieve all Projects
/projects

Returns a list of the current user’s projects.

  • Response  200
  • Body
    {
      "projects": [
        {
          "href": "https://api.packet.net/projects/739ff9c9-0834-44c8-bba6-6a71b9a96783",
          "id": "739ff9c9-0834-44c8-bba6-6a71b9a96783",
          "name": "A Test Project",
          ...
        },
        {
          "href": "https://api.packet.net/projects/74e70cdd-b51d-4d69-bf0c-ccf920643d7a",
          "id": "74e70cdd-b51d-4d69-bf0c-ccf920643d7a",
          "name": "My Second Project",
          ...
        },
        ...
      ]
    }
    
Create a Project
/projects

Creates a new projects and adds the current user as a member.

  • Request
  • Body
    {
      "name": "My New Project",
      "payment_method": "eedbb692-b217-477f-bfe5-8dd58df1cd09" // optional
    }
    
  • Response  201
  • Headers
    Location: https://api.packet.net/projects/9317a146-bdb8-4d73-a59e-2cca97aaabbd rel="self"
    Body
    {
      "id": "9317a146-bdb8-4d73-a59e-2cca97aaabbd",
      "href": "https://api.packet.net/projects/9317a146-bdb8-4d73-a59e-2cca97aaabbd",
      "name": "My Project",
      "members": [
        { "href": "https://api.packet.net/users/0ad30f88-b3b5-46bf-a485-8132f858f8c8" },
        { "href": "https://api.packet.net/users/9793d8a9-3e7e-487e-9042-78aa2f4e1d9d" },
        ...
      ],
      "memberships": [
        { "href": "https://api.packet.net/memberships/e4db34df-bb03-43a1-bd46-3f91ade18ed4" },
        { "href": "https://api.packet.net/memberships/bde083f5-67b6-4593-b3ee-e63ac3d7f79a" },
        ...
      ],
      "invitations": [
        { "href": "https://api.packet.net/invitations/9aa3bd55-5209-42b6-9ed8-ec72ba043dba" }
      ],
      "devices": [],
      "payment_method": {
        "href": "https://api.packet.net/payment-methods/eedbb692-b217-477f-bfe5-8dd58df1cd09",
      },
      "created_at": "2014-04-14T02:15:15Z",
      "updated_at": "2014-04-28T01:18:50Z"
    }
    

Project 

A single project object.

Retrieve a Project
/projects/{id}
  • Parameters
  • id
    string (required) 

    The project ID

  • Response  200
  • Body
    {
      "id": "75bd5fcb-dc4f-4f2b-8626-eaed6ee21ad1",
      "href": "https://api.packet.net/projects/75bd5fcb-dc4f-4f2b-8626-eaed6ee21ad1",
      "name": "My Project",
      "members": [
        { "href": "https://api.packet.net/users/0ad30f88-b3b5-46bf-a485-8132f858f8c8" },
        { "href": "https://api.packet.net/users/9793d8a9-3e7e-487e-9042-78aa2f4e1d9d" },
        ...
      ],
      "memberships": [
        { "href": "https://api.packet.net/memberships/e4db34df-bb03-43a1-bd46-3f91ade18ed4" },
        { "href": "https://api.packet.net/memberships/bde083f5-67b6-4593-b3ee-e63ac3d7f79a" },
        ...
      ],
      "invitations": [
        { "href": "https://api.packet.net/invitations/9aa3bd55-5209-42b6-9ed8-ec72ba043dba" }
      ],
      "devices": [ ... ],
      "payment_method": {
        "href": "https://api.packet.net/payment-methods/27613a27-1169-49e7-aa04-6fde97702ba0"
      },
      "default_for": "23a57279-8304-437d-9517-ebdbacf6413c",
      "created_at": "2014-04-14T02:15:15Z",
      "updated_at": "2014-04-28T01:18:50Z"
    }
    
Update a Project
/projects/{id}
  • Parameters
  • id
    string (required) 

    The project ID

  • Request
  • Body
    {
      "name": "My Updated Project",
      "payment_method": "511a27d6-1066-4525-9fe5-53dc3b7f2f6f"
    }
    
  • Response  200
  • Body
    {
      "id": "75bd5fcb-dc4f-4f2b-8626-eaed6ee21ad1",
      "href": "https://api.packet.net/projects/75bd5fcb-dc4f-4f2b-8626-eaed6ee21ad1",
      "name": "My Project",
      "members": [
        { "href": "https://api.packet.net/users/0ad30f88-b3b5-46bf-a485-8132f858f8c8" },
        { "href": "https://api.packet.net/users/9793d8a9-3e7e-487e-9042-78aa2f4e1d9d" },
        ...
      ],
      "memberships": [
        { "href": "https://api.packet.net/memberships/e4db34df-bb03-43a1-bd46-3f91ade18ed4" },
        { "href": "https://api.packet.net/memberships/bde083f5-67b6-4593-b3ee-e63ac3d7f79a" },
        ...
      ],
      "invitations": [
        { "href": "https://api.packet.net/invitations/9aa3bd55-5209-42b6-9ed8-ec72ba043dba" }
      ],
      "devices": [ ... ],
      "payment_method": {
        "href": "https://api.packet.net/payment-methods/27613a27-1169-49e7-aa04-6fde97702ba0"
      },
      "default_for": "23a57279-8304-437d-9517-ebdbacf6413c",
      "created_at": "2014-04-14T02:15:15Z",
      "updated_at": "2014-04-28T01:18:50Z"
    }
    
Delete a Project
/projects/{id}

Deletes a device and de-provisions it in our datacenter.

  • Parameters
  • id
    string (required) 

    The project ID

  • Response  204

Events 

Provides a list of events for a single project.

Retrieves an array of events
/projects/{id}/events
  • Parameters
  • id
    string (required) 

    The project ID.

  • Response  200
  • Body
    {
      "events": [
        {
          "id": "60670752-25cd-426e-9faa-86a602ca4c90",
          "type": "membership.created",
          "body": "%user% is now a member of the project \"%project%\"",
          "created_at": "2015-05-14T12:50:47Z",
          "relationships": [
            {
              "id": "f6c0878f-4447-4543-9316-cddfa896107b"
            },
            {
              "id": "1ff8f822-4864-45f5-95ed-7fe73a3091b7"
            }
          ],
          "interpolated": "Dolly Example is now a member of the project \"Foo Bar Project\"",
          "href": "/events/60670752-25cd-426e-9faa-86a602ca4c90"
        },
        ...
      ]
    }
    

Membership 

A single membership record for a project.

A membership has the following parameters:

  • id

  • user

  • project

  • roles

Retrieve a Membership
/memberships/{id}

Returns a single membership object.

  • Parameters
  • id
    string (required) 

    The membership ID.

  • Response  200
  • Body
    {
      "id": "7a156b4f-cefb-4b94-a295-452c9e9fdb5f",
      "href": "https://api.packet.net/memberships/7a156b4f-cefb-4b94-a295-452c9e9fdb5f",
      "project": { "href": "https://api.packet.net/projects/591144ca-d479-407a-a4bc-042cda95a1d1" },
      "user": { "href": "https://api.packet.net/users/2084e6f4-d7c0-4300-ab03-53830c9ddb01" },
      "owner": true,
      "roles": [ "collaborator", "billing" ],
      "created_at": "2014-09-29T15:14:34Z",
      "updated_at": "2014-10-01T09:34:12Z"
    }
    
Update a Membership
/memberships/{id}

Updates a membership record.

  • Parameters
  • id
    string (required) 

    The membership ID.

  • Request
  • Body
    {
      "roles": [ "collaborator" ]
    }
    
  • Response  204
Delete a Membership
/memberships/{id}

Deletes a membership record. This will remove the user from the project.

  • Parameters
  • id
    string (required) 

    The membership ID.

  • Response  204

Invitations 

In order to add a user to a project, they must first be invited.

Create a Project Invitation
/projects/{id}/invitations
  • Request
  • Body
    {
      "user": "3624b674-ca22-4bd6-a8d7-2090a2a2c15d",
      // or
      "user": "billy@example.com",
      "message": "Welcome to my project!",
      "roles": [ "collaborator", "billing" ]
    }
    
  • Response  201
  • Headers
    Location: https://api.packet.net/invitations/8738dd01-7246-443a-95b8-c8c493bd2c9b rel="self"
    Body
    {
      "href": "https://api.packet.net/invitations/8738dd01-7246-443a-95b8-c8c493bd2c9b"
    }
    

Invitation 

A single invitation record.

View an Invitation
/invitations/{id}
  • Response  200
  • Body
    {
      "id": "7a156b4f-cefb-4b94-a295-452c9e9fdb5f",
      "href": "https://api.packet.net/memberships/7a156b4f-cefb-4b94-a295-452c9e9fdb5f",
      "project": { "href": "https://api.packet.net/projects/591144ca-d479-407a-a4bc-042cda95a1d1" },
      "user": { "href": "https://api.packet.net/users/2084e6f4-d7c0-4300-ab03-53830c9ddb01" },
      "owner": true,
      "roles": [ "collaborator", "billing" ],
      "created_at": "2014-09-29T15:14:34Z",
      "updated_at": "2014-10-01T09:34:12Z"
    }
    
Accept an Invitation
/invitations/{id}
  • Response  204
Decline an Invitation
/invitations/{id}
  • Response  204

Transfer Requests 

Project owners can transfer ownership of their projects to other members.

Create a Transfer Request
/projects/{id}/transfers
  • Response  201
  • Headers
    Location: https://api.packet.net/transfers/1631425e-5a68-40c2-8075-8923ce306707 rel="self"
    Body
    {
      "href": "https://api.packet.net/transfers/1631425e-5a68-40c2-8075-8923ce306707"
    }
    

Transfer Request 

Accept or decline a transfer request.

View a Transfer Request
/transfers/{id}
  • Parameters
  • id
    string (required) 

    The membership ID.

  • Response  200
  • Body
    {
      "id": "7a156b4f-cefb-4b94-a295-452c9e9fdb5f",
      "href": "https://api.packet.net/transfers/7a156b4f-cefb-4b94-a295-452c9e9fdb5f",
      "project": { "href": "https://api.packet.net/projects/591144ca-d479-407a-a4bc-042cda95a1d1" },
      "membership": { "href": "https://api.packet.net/memberships/2084e6f4-d7c0-4300-ab03-53830c9ddb01" },
      "created_at": "2014-09-29T15:14:34Z",
      "updated_at": "2014-10-01T09:34:12Z"
    }
    
Accept a Transfer Request
/transfers/{id}
  • Parameters
  • id
    string (required) 

    The membership ID.

  • Response  204
Decline a Transfer Request
/transfers/{id}
  • Parameters
  • id
    string (required) 

    The membership ID.

  • Response  204
  • Body
    # Group Users
    Manage your user account.
    
    

Users 

Retrieve all Users
/users

Returns a list of users that the are accessible to the current user (all users in the current user’s projects, essentially).

  • Response  200
  • Body
    {
      "users": [
        { "href": "https://api.packet.net/users/fbfe76e3-62b3-47a9-ae20-20dd3a943dba" },
        { "href": "https://api.packet.net/users/9b250695-03d1-4cc2-a8f6-a61187774b74" },
        { "href": "https://api.packet.net/users/dc9c92ab-b2ed-44f1-aa50-34d91b7a5e07" }
      ]
    }
    

User 

Retrieve a User
/users/{id}
  • Response  200
  • Body
        {
          "id": "faaaec30-be0c-4b6d-b1a7-1bf6e494a333",
          "first_name": "Melissa",
          "last_name": "Smith",
          "full_name": "Melissa Smith",
          "email": "melissa@example.com",
          "two_factor_auth": "sms",
          "timezone": "America/New_York",
          "twitter": "@melissasmith",
          "facebook": "https://facebook.com/melissa.smith",
          "linkedin": "melissasmith",
          "phone_number": "555-555-5555",
          "emails": [ { "href": "https://api.packet.net/emails/7e407a6a-4f96-4da0-8c48-5665352ebf06" } ],
          "created_at": "2014-04-14T02:15:15Z",
          "updated_at": "2014-04-14T02:15:15Z"
        }
    

Current User 

The currently logged-in user.

Retrieve the Current User
/user

Returns the user object for the currently logged-in user.

  • Response  200
  • Body
        {
          "id": "faaaec30-be0c-4b6d-b1a7-1bf6e494a333",
          "first_name": "Melissa",
          "last_name": "Smith",
          "full_name": "Melissa Smith",
          "email": "melissa@example.com",
          "two_factor_auth": "sms",
          "timezone": "America/New_York",
          "twitter": "@melissasmith",
          "facebook": "https://facebook.com/melissa.smith",
          "linkedin": "melissasmith",
          "phone_number": "555-555-5555",
          "emails": [ { "href": "https://api.packet.net/emails/7e407a6a-4f96-4da0-8c48-5665352ebf06" } ],
          "created_at": "2014-04-14T02:15:15Z",
          "updated_at": "2014-04-14T02:15:15Z"
        }
    
Update the Current User
/user

Updates the currently logged-in user.

  • Request
  • Body
    {
      "timezone": "America/Chicago"
    }
    
  • Response  204

SSH Keys 

A collection of the user’s ssh keys.

Retrieve all SSH Keys
/ssh-keys

Returns an array of ssh keys.

  • Response  200
  • Body
    {
      "ssh_keys": [
        {
          "id": "ded9047b-1872-467a-ab4a-ac042aafbbdc",
          "label": "My Key Label",
          "key": "ssh-rsa CACVB3NzaC1yc2EAAAADAQABAAABAQC...",
          "fingerprint": "74:f6:47:91:78:a2:c7:1e:ef:73:c9:b3:17:ab:ec:c9",
          "created_at": "2015-06-01T18:37:09Z",
          "updated_at": "2015-06-01T18:38:45Z",
          "user": {
            "href": "/users/9e0acc49-cfe3-4a07-b3b1-a8a3135a6571"
          },
          "href": "/ssh-keys/ded9047b-1872-467a-ab4a-ac042aafbbdc"
        },
        ...
      ]
    }
    
Create a SSH Key
/ssh-keys

Add a new ssh key for the current user.

  • Request
  • Body
    {
      "label":"My New SSH Key",
      "key":"ssh-rsa BBBBC4a99Eklf7..."
    }
    

SSH Key 

Returns a single ssh key object.

Retrieve a SSH Key
/ssh-keys/{id}
  • Parameters
  • id
    string (required) 

    The ssh key ID to retrieve.

  • Response  200
  • Body
    {
      "id": "ded9047b-1872-467a-ab4a-ac042aafbbdc",
      "label": "My Key Label",
      "key": "ssh-rsa CACVB3NzaC1yc2EAAAADAQABAAABAQC...",
      "fingerprint": "74:f6:47:91:78:a2:c7:1e:ef:73:c9:b3:17:ab:ec:c9",
      "created_at": "2015-06-01T18:37:09Z",
      "updated_at": "2015-06-01T18:38:45Z",
      "user": {
        "href": "/users/9e0acc49-cfe3-4a07-b3b1-a8a3135a6571"
      },
      "href": "/ssh-keys/ded9047b-1872-467a-ab4a-ac042aafbbdc"
    }
    
Update a SSH Key
/ssh-keys/{id}
  • Parameters
  • id
    string (required) 

    The ssh key ID to update.

  • Request
  • Body
    {
      "label":"My new label",
      "key": "ssh-rsa CACVB3NzaC1yc2EAAAADAQABAAABAQC..."
    }
    
  • Response  200
  • Body
    {
      "id": "ded9047b-1872-467a-ab4a-ac042aafbbdc",
      "label": "My new label",
      "key": "ssh-rsa CACVB3NzaC1yc2EAAAADAQABAAABAQC...",
      "fingerprint": "74:f6:47:91:78:a2:c7:1e:ef:73:c9:b3:17:ab:ec:c9",
      "created_at": "2015-06-01T18:37:09Z",
      "updated_at": "2015-06-01T18:38:45Z",
      "user": {
        "href": "/users/9e0acc49-cfe3-4a07-b3b1-a8a3135a6571"
      },
      "href": "/ssh-keys/ded9047b-1872-467a-ab4a-ac042aafbbdc"
    }
    
Delete a SSH Key
/ssh-keys/{id}

Delete a SSH Key.

  • Parameters
  • id
    string (required) 

    The ssh key ID to delete.

  • Response  200
  • Body
    Events are things that happen in the system that are worth tracking, but not
    necessarily worth sending users a notification about. An example of this is
    when a new user is added to an organization that you're a part of.
    

Events 

A collection of events pertaining to the current user, their devices, or their organizations.

Retrieve all Events
/events{?since}

Returns a list of the current user’s events.

  • Parameters
  • since
    string (optional) Default: Time.now 

    Only include notifications updated since the given datetime. Must be a UTC datetime in ISO8601 format.

  • Response  200
  • Body
    {
      "events": [
        { "href": "https://api.packet.net/events/ED55EFBD-051A-4872-A920-A89C317E87FE" },
        ...
      ]
    }
    

Event 

A single event object.

Retrieve an Event
/events/{id}
  • Parameters
  • id
    string (required) 

    The event ID in the form of a UUID.

  • Response  200
  • Body
    {
      "id": "F63176A7-C88C-4026-848F-38F196FBA850",
      "message": {
        "raw": "%actor% created a new device %device%",
        "formatted": "Kevin R. created a new device \"DB 2\""
      },
      "type": "device:created",
      "created_at": "2014-08-25T21:40:40Z",
      "relationships": {
        "actor": {
          "href": "https://api.packet.net/users/8967F2AC-C3AC-4BF3-8405-219043325A70"
        },
        "device": {
          "href": "https://api.packet.net/devices/93FD35D9-9CBC-46C4-8E2B-B7897496AC8B"
        }
      }
    }
    

Notifications 

A collection of the current user’s notifications.

Retrieve all Notifications
/notifications{?all,since}

Returns a list of the current user’s notifications.

  • Parameters
  • all
    boolean (optional) Default: false 

    Whether to include read notification in the listing.

    since
    string (optional) Default: Time.now 

    Only include notifications updated since the given datetime. Must be a UTC datetime in ISO8601 format.

  • Response  200

Notification 

A single notification object.

A notification has the following properties:

  • id

  • body

  • read

  • user

  • created_at

  • updated_at

Retrieve a Notification
/notifications/{id}
  • Parameters
  • id
    string (required) 

    The notification ID in the form of a UUID.

  • Response  200
  • Body
    {
      "id": "566ccde0-4347-11e4-826c-48d705c8e127",
      "body": "This is a test notification",
      "read": false,
      "user": {
        "href": "https://api.packet.net/users/76aff050-4347-11e4-9bf7-48d705c8e127"
      },
      "created_at": "2014-04-14T02:15:15Z",
      "updated_at": "2014-04-15T05:23:13Z"
    }
    
Update a Notification
/notifications/{id}

Updates a single notification. Currently, the only supported operating is marking a notification as read.

  • Parameters
  • id
    string (required) 

    The notification ID in the form of a UUID.

  • Request
  • Body
    {
      "read": true
    }
    
  • Response  204

Email 

Add a new email address to the current user

Create an email
/emails
  • Request
  • Body
    {
      "address": "foobar@packet.net",
      "default": false
    }
    
  • Response  201
  • Headers
    Location: https://api.packet.net/emails/0ff654ec-626c-4e4e-9395-dd23dcbc4337
    Body
    {
      "id": "0ff654ec-626c-4e4e-9395-dd23dcbc4337",
      "address": "foobar@packet.net",
      "default": false,
      "href": "/emails/0ff654ec-626c-4e4e-9395-dd23dcbc4337"
    }
    

Email 

Provides one of the user’s emails.

Retrieve an email
/emails/{id}
  • Parameters
  • id
    string (required) 

    The email ID

  • Response  200
  • Body
    {
      "id": "eea9d29e-40c1-4717-a1a2-a1df3e053a57",
      "address": "example@packet.net",
      "default": true,
      "href": "/emails/eea9d29e-40c1-4717-a1a2-a1df3e053a57"
    }
    
Update an email
/emails/{id}
  • Parameters
  • id
    string (required) 

    The email ID

  • Request
  • Body
    {
      "default": true
    }
    
  • Response  200
  • Body
    {
      "id": "eea9d29e-40c1-4717-a1a2-a1df3e053a57",
      "address": "example@packet.net",
      "default": true,
      "href": "/emails/eea9d29e-40c1-4717-a1a2-a1df3e053a57"
    }
    
Delete an email
/emails/{id}

Delete any email address except the default one.

  • Parameters
  • id
    string (required) 

    The email ID.

  • Response  204
Previous