Projects
Introduction
# Projects GET https://api.ittybit.com/projects POST https://api.ittybit.com/projects # Project GET https://api.ittybit.com/projects/:id PATCH https://api.ittybit.com/projects/:id 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
const BASE_URL = "https://api.ittybit.com"; const response = await fetch(`https://api.ittybit.com/projects`, { headers: { Authorization: `Bearer ${ITTYBIT_API_KEY}`, }, });
curl "https://api.ittybit.com/projects" -H "Authorization: Bearer ITTYBIT_API_KEY"
Returns a list of all projects.
Endpoint
GET /projects
{ "meta":{ "id": "req_abcdefgh1234", "method": "GET", "host": "https://api.ittybit.com", "path": "/projects", "version": "2024-08-21", "status": 200, "org_id": "org_abcdefgh1234", "type": "list", "total": 15, "limit": 12, "page": 1, "pages": 2 }, "data": [ { "id": "prj_abcdefgh1234", "object": "project", "name": "My Project", // ... other props }, // ... other projects ], "links": { "self": "https://api.ittybit.com/projects", "next": "https://api.ittybit.com/projects?page=2", "prev": null, } }
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
const BASE_URL = "https://api.ittybit.com"; const response = await fetch(`https://api.ittybit.com/projects`, { headers: { Method: "POST", Authorization: `Bearer ${ITTYBIT_API_KEY}`, "Content-Type": "application/json", body: JSON.stringify({ name: "My New Project", description: "This is a new project description", alias: "newproject", }), }, });
curl -X POST "https://api.ittybit.com/projects" -H "Authorization: Bearer ITTYBIT_API_KEY" -H "Content-Type: application/json" -d '{ "name": "My New Project", "description": "This is a new project description", "alias": "newproject" }'
Creates a new project.
Endpoint
POST /projects
{ "meta":{ "id": "req_abcdefgh1234", "method": "POST", "host": "https://api.ittybit.com", "path": "/projects", "version": "2024-08-21", "status": 200, "org_id": "org_abcdefgh1234", "type": "object" }, "data": { "id": "prj_abcdefgh5678", "object": "project", "name": "My New Project", "description": "This is a new project description", "alias": "newproject", "domain": "newproject.ittybit.com", "status": "active", "created": "2024-03-30T15:00:00Z", "updated": "2024-03-30T15:00:00Z", }, "links": { "self": "https://api.ittybit.com/projects/prj_abcdefgh5678", "parent": "https://api.ittybit.com/projects", } }
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
const BASE_URL = "https://api.ittybit.com"; const response = await fetch(`https://api.ittybit.com/projects/prj_abcdefgh1234`, { headers: { Authorization: `Bearer ${ITTYBIT_API_KEY}`, }, });
curl "https://api.ittybit.com/projects/prj_abcdefgh1234" -H "Authorization: Bearer ITTYBIT_API_KEY"
Returns the details for a single project.
Endpoint
GET /project/:id
{ "meta":{ "id": "req_abcdefgh1234", "method": "GET", "host": "https://api.ittybit.com", "path": "/projects/prj_abcdefgh1234", "version": "2024-08-21", "status": 200, "org_id": "org_abcdefgh1234", "type": "object" }, "data": { "id": "prj_abcdefgh1234", "object": "project", "name": "My Project", "description": "This is a project description", "alias": "myproject", "domain": "myproject.ittybit.com", "status": "active", "created": "2024-03-30T13:00:00Z", "updated": "2024-03-30T14:00:00Z", }, "links": { "self": "https://api.ittybit.com/projects/prj_abcdefgh1234", "parent": "https://api.ittybit.com/projects", } }
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
const BASE_URL = "https://api.ittybit.com"; const response = await fetch(`https://api.ittybit.com/projects/prj_abcdefgh1234`, { headers: { Method: "PATCH", Authorization: `Bearer ${ITTYBIT_API_KEY}`, "Content-Type": "application/json", body: JSON.stringify({ name: "My Updated Project", description: "This is an updated project description", }), }, });
curl -X PATCH "https://api.ittybit.com/projects/prj_abcdefgh" -H "Authorization: Bearer ITTYBIT_API_KEY" -H "Content-Type: application/json" -d '{ "name": "My Updated Project", "description": "This is an updated project description" }'
Updates a project's metadata.
Endpoint
PATCH /projects/:id
{ "meta":{ "id": "req_abcdefgh1234", "method": "PATCH", "host": "https://api.ittybit.com", "path": "/projects/prj_abcdefgh1234", "version": "2024-08-21", "status": 200, "org_id": "org_abcdefgh1234", "type": "object" }, "data": { "id": "prj_abcdefgh1234", "object": "project", "name": "My Updated Project", "description": "This is an updated project description", "alias": "myproject", "domain": "myproject.ittybit.com", "status": "active", "created": "2024-03-30T13:00:00Z", "updated": "2024-03-30T16:00:00Z", }, "links": { "self": "https://api.ittybit.com/projects/prj_abcdefgh1234", "parent": "https://api.ittybit.com/projects", } }
Body Parameters
-
name string
A human-readable name for the project.
-
description string
A human-readable description of the project.
Delete Project
const BASE_URL = "https://api.ittybit.com"; const response = await fetch(`https://api.ittybit.com/projects/prj_abcdefgh1234`, { headers: { Method: "DELETE", Authorization: `Bearer ${ITTYBIT_API_KEY}`, }, });
curl -X DELETE "https://api.ittybit.com/projects/prj_abcdefgh" -H "Authorization: Bearer ITTYBIT_API_KEY"
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
{ "meta":{ "id": "req_abcdefgh1234", "method": "DELETE", "host": "https://api.ittybit.com", "path": "/projects/prj_abcdefgh1234", "version": "2024-08-21", "status": 200, "org_id": "org_abcdefgh1234", "type": "object" }, "data": { "id": "prj_abcdefgh1234", "object": "project", "status": "deleted", "created": "2024-03-30T13:00:00Z", "updated": "2024-03-30T16:00:00Z", }, "links": { "parent": "https://api.ittybit.com/projects", } }