API Documentation

The PhotoStack API is built on REST principles, offering predictable, resource-oriented endpoints. It supports form-encoded request bodies, returns responses in JSON format, and adheres to standard HTTP methods, authentication protocols, and status codes for seamless integration and predictable behavior.

The PhotoStack API lets you create custom integrations to further streamline workflows and enhance the photographer experience. We look forward to seeing the innovative solutions you build!

Authentication

Authentication is made via the header with the key Authorization in the format Bearer TOKEN

Endpoints
GET /validate

Validate

We can check if the user has entered a valid Token by querying /validate/ passing Authorization in as header using Bearer TOKEN.

Query
curl --location --request GET 'https://api.photostack.io/validate/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
  {
      "message": "200 - Authenticated."
  }
]
Status Codes
200 Valid API token provided 400 Token not specified 401 Invalid API token provided 403 Account inactive 405 Method not supported

Settings

A list of settings and account details related to the PhotoStack user's account.

Endpoints
GET /settings

List all Settings

Query
curl --location --request GET 'https://api.photostack.io/settings/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
    {
        "id": "12345",
        "domain": "johnsmithphotography.com",
        "title": "John Smith Photography",
        "package": "Pro Unlimited",
        "usage": "220 GB / 1 TB",
        "limit_in_bytes": 1099511627776,
        "usage_in_bytes": 236223201280
    }
]
Status Codes
200 Successfully executed query 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 403 Account inactive 404 API resource doesn't exist 405 Method not supported, only GET, POST, PATCH & DELETE are supported 503 API unavailable

Clients

A list of Clients a user can deliver photos to, in the Clients Area. Clients are usually named after the business or the people the photos are shot for. For example 'Joe's Windows LTD' or 'Kate + John'.

Endpoints
GET /clients/:id GET /clients POST /clients PATCH /clients/:id DELETE /clients/:id

List all Clients

We can check if the user has entered a valid Token by querying /validate/ passing Authorization in as header using Bearer TOKEN.

Query
curl --location --request GET 'https://api.photostack.io/clients/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
    {
        "id": "1",
        "client": "Joe's Windows LTD"
    },
    {
        "id": "2",
        "client": "Kate + John"
    }
]
Status Codes
200 Successfully executed query 201 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 403 Account inactive 404 API resource doesn't exist 405 Method not supported, only GET, POST, PATCH & DELETE are supported 409 Conflict, item already exists 503 API unavailable

List single Client

Specify an id number in the request URL to get a single client's details.

Query
curl --location --request GET 'https://api.photostack.io/clients/1234/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
    {
        "id": "1234",
        "client": "Super Cool Hats"
    }
]
Status Codes
200 Successfully executed query 201 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 403 Account inactive 404 API resource doesn't exist 405 Method not supported, only GET, POST, PATCH & DELETE are supported 409 Conflict, item already exists 503 API unavailable

Create a new Client

Parameters required:

client string

The name of the new client in plain text.

Query
curl --location --request POST 'https://api.photostack.io/clients/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5' \
--data-raw '{"client":"Oooober"}'
Response
[
    {
        "id": "1234",
        "client": "Oooober"
    }
]
Status Codes
200 Successfully executed query 201 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 403 Account inactive 404 API resource doesn't exist 405 Method not supported, only GET, POST, PATCH & DELETE are supported 409 Conflict, item already exists 503 API unavailable

Update a Client

Update a client name by id. Parameters required:

client string

Query
curl --location --request PATCH 'https://api.photostack.io/clients/1234/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5' \
--header 'Content-Type: application/json' \
--data-raw '{"client":"Super Cool Hats"}'
Response
[
    {
        "id": "1234",
        "client": "Super Cool Hats"
    }
]
Status Codes
200 Successfully updated item 400 Incomplete parameters received 401 Invalid token provided 403 Account inactive 404 Item not found 405 Method not supported 503 API unavailable

Delete a Client

Soft delete a client by id.

Query
curl --location --request DELETE 'https://api.photostack.io/clients/1234/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
  {
      "message": "deleted"
  }
]
Status Codes
200 Successfully deleted item 400 No ID set 401 Invalid token provided 403 Account inactive 404 Item not found 405 Method not supported 503 API unavailable

Collections

A list of created Collections of photos. Collections can be either of type Portfolio which show on the user's website or type Client where the collection shows in the Clients Area for only the Client.

Endpoints
GET /collections/:id GET /collections POST /collections PATCH /collections/:id DELETE /collections/:id

List all Collections

Query
curl --location --request GET 'https://api.photostack.io/collections/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
    {
        "id": "1",
        "name": "Portraits",
        "url": "portraits",
        "type": "portfolio",
        "client": "0",
        "watermark": null,
        "watermark_originals": 0
    },
    {
        "id": "3",
        "name": "Kate + John",
        "url": "kate-and-john",
        "type": "client",
        "client": "2",
        "watermark": "2",
        "watermark_originals": 1
    }
]
Status Codes
200 Successfully executed query 204 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 404 API resource doesn't exist 405 Method not supported, only GET & POST are supported 409 Conflict, item already exists 503 API unavailable

List single Collection

Specify an id number in the request URL to get a single collection's details.

Query
curl --location --request GET 'https://api.photostack.io/collections/3/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
    {
        "id": "3",
        "name": "Kate + John",
        "url": "kate-and-john",
        "type": "client",
        "client": "2",
        "watermark": "2",
        "watermark_originals": 1
    }
]
Status Codes
200 Successfully executed query 204 Successfully created item 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 404 API resource doesn't exist 405 Method not supported, only GET & POST are supported 409 Conflict, item already exists 503 API unavailable

Create a new Collection

Parameters required:

name string

The name of the new collection in plain text.

client integer

For collection type of Portfolio set client to 0, for collection type of Client set the client to the relevant client ID.

Optional:

job integer

Link the collection to an existing job id. If set, job must belong to the same client.

watermark integer

Set a watermark id from /watermarks. Use 0 or omit to leave unset.

watermark_originals boolean|integer

Set to 1 (or true) to generate a watermarked full-resolution copy at /w/filename. Root original remains pristine.

Query
curl --location --request POST 'https://api.photostack.io/collections/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5' \
--data-raw '{"name":"Oooober Head Shots", "client":"1234"}'
Response
[
    {
        "id": "1234",
        "name": "Oooober Head Shots",
        "url": "oooober-head-shots",
        "client": "1234",
        "job": "987",
        "watermark": "2",
        "watermark_originals": 1
    }
]
Status Codes
201 Successfully created item 400 Incomplete parameters received 401 Invalid token provided 403 Account inactive 405 Method not supported, only GET, POST, PATCH & DELETE are supported 409 Conflict, item already exists 503 API unavailable

Update a Collection

Update collection fields by id.

Accepted parameters:

name string
client integer
job integer
cover integer
watermark integer
watermark_originals boolean|integer

Set watermark to 0 to clear. If watermark is cleared, watermark_originals is forced to 0.

Query
curl --location --request PATCH 'https://api.photostack.io/collections/3/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5' \
--header 'Content-Type: application/json' \
--data-raw '{"name":"Kate + John", "cover":"430", "watermark":"2", "watermark_originals":1}'
Response
[
    {
        "id": "3",
        "name": "Kate + John",
        "url": "kate-and-john",
        "client": "2",
        "job": "0",
        "cover": "430",
        "watermark": "2",
        "watermark_originals": 1
    }
]
Status Codes
200 Successfully updated item 400 Incomplete parameters received 401 Invalid token provided 403 Account inactive 404 Item not found 405 Method not supported 409 Conflict, URL already exists 503 API unavailable

Delete a Collection

Soft delete a collection by id.

Query
curl --location --request DELETE 'https://api.photostack.io/collections/3/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
  {
      "message": "deleted"
  }
]
Status Codes
200 Successfully deleted item 400 No ID set 401 Invalid token provided 403 Account inactive 404 Item not found 405 Method not supported 503 API unavailable

Images

A list of Images organised into Collections.

Endpoints
GET /collections/:id/images GET /collections/:id/images/:id POST /collections/:id/images PATCH /images/:id DELETE /images/:id POST /images/:id

List all Images in a Collection

Specify an id number in the request URL to get a collection's images. Optional filter: filename to match an exact filename.

Query
curl --location --request GET 'https://api.photostack.io/collections/4/images/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
    {
        "id": "428",
        "collection": "4",
        "filename": "Oooober Head Shots - IMG_0480.jpg",
        "cdn": "https://cdn.photostack.io/images/collections/4/Oooober%20Head%20Shots%20-%20IMG_0480.jpg",
        "link": "https://example.com/portraits/#428"
    }
]
Status Codes
200 Successfully executed query 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 403 Account inactive 404 API resource doesn't exist 405 Method not supported, only GET, POST, PATCH & DELETE are supported 503 API unavailable

List single Image in a Collection

Specify an id number for both the collection and image in the request URL to get a specific image's data. Optional filter: filename to match an exact filename.

Query
curl --location --request GET 'https://api.photostack.io/collections/4/images/430/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
    {
        "id": "430",
        "collection": "4",
        "filename": "Oooober Head Shots - IMG_0482.jpg",
        "cdn": "https://cdn.photostack.io/images/collections/4/Oooober%20Head%20Shots%20-%20IMG_0482.jpg",
        "link": "https://example.com/portraits/#430"
    }
]
Status Codes
200 Successfully executed query 204 Success but empty result 400 Incomplete parameters received 401 Invalid token provided 403 Account inactive 404 API resource doesn't exist 405 Method not supported, only GET, POST, PATCH & DELETE are supported 503 API unavailable

Upload a new Image to a Collection

Specify an id number in the request URL to set the destination collection.

Parameters required:

upload file

The image to be uploaded should be sent as form-data with the key name upload.

Optional:

keywords string|array

Comma-separated keywords or an array to store on the image.

Images can be in the following formats:

.jpg
.jpeg
.png
.gif

Maximum file size allowed is 100MB.

Query
curl --location --request POST 'https://api.photostack.io/collections/4/images/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5' \
--form 'upload=@"path/filename.jpg"'
Response
[
    {
        "id": "430",
        "collection": "4",
        "filename": "filename.jpg",
        "cdn": "https://cdn.photostack.io/images/collections/4/filename.jpg",
        "link": "https://example.com/portraits/#430",
        "request": "abcd1234ef567890"
    }
]
Status Codes
201 Successfully created item 400 Incomplete parameters received 401 Invalid token provided 403 Account inactive 405 Method not supported, only GET, POST, PATCH & DELETE are supported 409 Conflict, item already exists 503 API unavailable

Update Image keywords

Update image keywords by id. Parameters required:

keywords string|array

Query
curl --location --request PATCH 'https://api.photostack.io/images/430/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5' \
--header 'Content-Type: application/json' \
--data-raw '{"keywords":"portraits, studio, headshot"}'
Response
[
    {
        "id": 430,
        "keywords": ["portraits", "studio", "headshot"]
    }
]
Status Codes
200 Successfully updated item 400 Incomplete parameters received 401 Invalid token provided 403 Account inactive 404 Item not found 405 Method not supported 503 API unavailable

Delete an Image

Soft delete an image by id.

Query
curl --location --request DELETE 'https://api.photostack.io/images/430/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
  {
      "message": "deleted"
  }
]
Status Codes
200 Successfully deleted item 400 No ID set 401 Invalid token provided 403 Account inactive 404 Item not found 405 Method not supported 503 API unavailable

Replace an Image

Replace the file for an existing image by id. Send upload as form-data. Optional keywords to update image keywords.

Query
curl --location --request POST 'https://api.photostack.io/images/430/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5' \
--form 'upload=@"path/filename.jpg"'
Response
[
    {
        "id": "430",
        "collection": "4",
        "filename": "filename.jpg",
        "cdn": "https://cdn.photostack.io/images/collections/4/filename.jpg",
        "link": "https://example.com/portraits/#430",
        "request": "abcd1234ef567890"
    }
]
Status Codes
200 Successfully replaced item 400 Incomplete parameters received 401 Invalid token provided 403 Account inactive 405 Method not supported 503 API unavailable

Jobs

A list of Jobs tied to a Client. Jobs can be retrieved per client id using /clients/:id/jobs.

Endpoints
GET /clients/:id/jobs GET /jobs/:id GET /jobs

List all Jobs

Returns all jobs for the authenticated account, ordered by start date.

Query
curl --location --request GET 'https://api.photostack.io/jobs/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
    {
        "id": "55",
        "job": "Summer Campaign",
        "client": "2",
        "start": "2024-08-10",
        "finish": "2024-08-12",
        "stage": "editing"
    }
]
Status Codes
200 Successfully executed query 204 Success but empty result 401 Invalid token provided 403 Account inactive 405 Method not supported 503 API unavailable

List single Job

Specify an id number in the request URL to get a single job.

Query
curl --location --request GET 'https://api.photostack.io/jobs/55/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
    {
        "id": "55",
        "job": "Summer Campaign",
        "client": "2",
        "start": "2024-08-10",
        "finish": "2024-08-12",
        "stage": "editing"
    }
]
Status Codes
200 Successfully executed query 204 Success but empty result 401 Invalid token provided 403 Account inactive 405 Method not supported 503 API unavailable

List Jobs by Client

Filter jobs by client id using the path /clients/:id/jobs/.

Query
curl --location --request GET 'https://api.photostack.io/clients/2/jobs/' \
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
    {
        "id": "55",
        "job": "Summer Campaign",
        "client": "2",
        "start": "2024-08-10",
        "finish": "2024-08-12",
        "stage": "editing"
    }
]
Status Codes
200 Successfully executed query 204 Success but empty result 401 Invalid token provided 403 Account inactive 405 Method not supported 503 API unavailable

Watermarks

A list of Watermarks available to the authenticated account. Use these ids when assigning a watermark to a collection.

Endpoints
GET /watermarks/:id GET /watermarks

List all Watermarks

Returns all active watermark presets for the authenticated account.

Query
curl --location --request GET 'https://api.photostack.io/watermarks/' 
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
    {
        "id": "1",
        "name": "Studio Signature",
        "type": "text"
    },
    {
        "id": "2",
        "name": "White Logo",
        "type": "graphic"
    }
]
Status Codes
200 Successfully executed query 204 Success but empty result 401 Invalid token provided 403 Account inactive 404 API resource doesn't exist 405 Method not supported, only GET, POST, PATCH & DELETE are supported 503 API unavailable

List single Watermark

Specify an id number in the request URL to get a single watermark.

Query
curl --location --request GET 'https://api.photostack.io/watermarks/2/' 
--header 'Authorization: Bearer 1111-2222-3333-4444-5'
Response
[
    {
        "id": "2",
        "name": "White Logo",
        "type": "graphic"
    }
]
Status Codes
200 Successfully executed query 204 Success but empty result 401 Invalid token provided 403 Account inactive 404 API resource doesn't exist 405 Method not supported, only GET, POST, PATCH & DELETE are supported 503 API unavailable