Projects

Introduction

endpoints

_10
# Projects
_10
GET https://api.ittybit.com/projects
_10
POST https://api.ittybit.com/projects
_10
_10
# Project
_10
GET https://api.ittybit.com/projects/:id
_10
PATCH https://api.ittybit.com/projects/:id
_10
DELETE https://api.ittybit.com/projects/:id

Projects are the primary way to organize and manage your media in Ittybit.

You may create different projects for each of your customers, to separate media for the different departments in your organization, or to maintain different environments within your project.

Note: This is an organisation-level resource so you will have to use an API Key with admin: true permissions to access this resource.


Endpoints

List Projects

request.js
request.sh

_10
const BASE_URL = "https://api.ittybit.com";
_10
_10
const response = await fetch(`${BASE_URL}/projects`, {
_10
headers: {
_10
Authorization: `Bearer ${env.ITTYBIT_API_KEY}`,
_10
},
_10
});

Returns a list of all projects.

Endpoint

GET /projects

response.json

_29
{
_29
"meta":{
_29
"id": "req_abcdefgh1234",,
_29
"method": "GET",
_29
"url": "/projects",
_29
"version": "2024-03-21",
_29
"status": 200,
_29
"org_id": "org_abcdefgh1234",
_29
"type": "list",
_29
"total": 15,
_29
"limit": 12,
_29
"page": 1,
_29
"pages": 2
_29
},
_29
"data": [
_29
{
_29
"id": "prj_abcdefgh1234",
_29
"object": "project",
_29
"name": "My Project",
_29
// ... other props
_29
},
_29
// ... other projects
_29
],
_29
"links": {
_29
"self": "/projects",
_29
"next": "/projects?page=2",
_29
"prev": null,
_29
}
_29
}

Query Parameters

  • page integer

    The page number to return. Default is 1.

  • limit integer

    The number of projects to return per page. Default is 12. Maximum is 100.


Create Project

request.js
request.sh

_14
const BASE_URL = "https://api.ittybit.com";
_14
_14
const response = await fetch(`${BASE_URL}/projects`, {
_14
headers: {
_14
Method: "POST",
_14
Authorization: `Bearer ${env.ITTYBIT_API_KEY}`,
_14
"Content-Type": "application/json",
_14
body: JSON.stringify({
_14
name: "My New Project",
_14
description: "This is a new project description",
_14
alias: "newproject",
_14
}),
_14
},
_14
});

Creates a new project.

Endpoint

POST /projects

response.json

_26
{
_26
"meta":{
_26
"id": "req_abcdefgh1234",,
_26
"method": "POST",
_26
"url": "/projects",
_26
"version": "2024-03-21",
_26
"status": 200,
_26
"org_id": "org_abcdefgh1234",
_26
"type": "object"
_26
},
_26
"data": {
_26
"id": "prj_abcdefgh5678",
_26
"object": "project",
_26
"name": "My New Project",
_26
"description": "This is a new project description",
_26
"alias": "newproject",
_26
"domain": "newproject.ittybit.com",
_26
"status": "active",
_26
"created": "2024-03-30T15:00:00Z",
_26
"updated": "2024-03-30T15:00:00Z",
_26
},
_26
"links": {
_26
"self": "/projects/prj_abcdefgh5678",
_26
"parent": "/projects",
_26
}
_26
}

Body Parameters

  • name string

    A human-readable name for the project.

  • description string

    A human-readable description of the project.

  • alias string

    A unique identifier for the project that can be used in URLs.


View Project

request.js
request.sh

_10
const BASE_URL = "https://api.ittybit.com";
_10
_10
const response = await fetch(`${BASE_URL}/projects/prj_abcdefgh1234`, {
_10
headers: {
_10
Authorization: `Bearer ${env.ITTYBIT_API_KEY}`,
_10
},
_10
});

Returns the details for a single project.

Endpoint

GET /project/:id

response.json

_26
{
_26
"meta":{
_26
"id": "req_abcdefgh1234",,
_26
"method": "GET",
_26
"url": "/projects/prj_abcdefgh1234",
_26
"version": "2024-03-21",
_26
"status": 200,
_26
"org_id": "org_abcdefgh1234",
_26
"type": "object"
_26
},
_26
"data": {
_26
"id": "prj_abcdefgh1234",
_26
"object": "project",
_26
"name": "My Project",
_26
"description": "This is a project description",
_26
"alias": "myproject",
_26
"domain": "myproject.ittybit.com",
_26
"status": "active",
_26
"created": "2024-03-30T13:00:00Z",
_26
"updated": "2024-03-30T14:00:00Z",
_26
},
_26
"links": {
_26
"self": "/projects/prj_abcdefgh1234",
_26
"parent": "/projects",
_26
}
_26
}

Response Parameters

  • id string

    Unique identifier for the project.

  • name string

    A human-readable name for the project.

  • description string

    A human-readable description of the project.

  • alias string

    A unique identifier for the project that can be used in URLs.

  • domain string

    The domain for the project.

  • status string

    The status of the project. Possible values are active, paused, suspended, deleted.

  • created datetime

    The date and time the project was created. ISO 8601 format.

  • updated datetime

    The date and time the project was last updated. ISO 8601 format.


Update Project

request.js
request.sh

_13
const BASE_URL = "https://api.ittybit.com";
_13
_13
const response = await fetch(`${BASE_URL}/projects/prj_abcdefgh1234`, {
_13
headers: {
_13
Method: "PATCH",
_13
Authorization: `Bearer ${env.ITTYBIT_API_KEY}`,
_13
"Content-Type": "application/json",
_13
body: JSON.stringify({
_13
name: "My Updated Project",
_13
description: "This is an updated project description",
_13
}),
_13
},
_13
});

Updates a project's metadata.

Endpoint

PATCH /projects/:id

response.json

_26
{
_26
"meta":{
_26
"id": "req_abcdefgh1234",,
_26
"method": "PATCH",
_26
"url": "/projects/prj_abcdefgh1234",
_26
"version": "2024-03-21",
_26
"status": 200,
_26
"org_id": "org_abcdefgh1234",
_26
"type": "object"
_26
},
_26
"data": {
_26
"id": "prj_abcdefgh1234",
_26
"object": "project",
_26
"name": "My Updated Project",
_26
"description": "This is an updated project description",
_26
"alias": "myproject",
_26
"domain": "myproject.ittybit.com",
_26
"status": "active",
_26
"created": "2024-03-30T13:00:00Z",
_26
"updated": "2024-03-30T16:00:00Z",
_26
},
_26
"links": {
_26
"self": "/projects/prj_abcdefgh1234",
_26
"parent": "/projects",
_26
}
_26
}

Body Parameters

  • name string

    A human-readable name for the project.

  • description string

    A human-readable description of the project.


Delete Project

request.js
request.sh

_10
const BASE_URL = "https://api.ittybit.com";
_10
_10
const response = await fetch(`${BASE_URL}/projects/prj_abcdefgh1234`, {
_10
headers: {
_10
Method: "DELETE",
_10
Authorization: `Bearer ${env.ITTYBIT_API_KEY}`,
_10
},
_10
});

Deletes a project.

NOTE: This action will delete the project and all its media. To avoid accidental data loss we will retain the data and files for 30 days before permanently deleting it. If you need to restore a project within this period, please contact support.

Endpoint

DELETE /projects/:id

response.json

_21
{
_21
"meta":{
_21
"id": "req_abcdefgh1234",,
_21
"method": "DELETE",
_21
"url": "/projects/prj_abcdefgh1234",
_21
"version": "2024-03-21",
_21
"status": 200,
_21
"org_id": "org_abcdefgh1234",
_21
"type": "object"
_21
},
_21
"data": {
_21
"id": "prj_abcdefgh1234",
_21
"object": "project",
_21
"status": "deleted",
_21
"created": "2024-03-30T13:00:00Z",
_21
"updated": "2024-03-30T16:00:00Z",
_21
},
_21
"links": {
_21
"parent": "/projects",
_21
}
_21
}