Project Management API Documentation
GET: Retrieve Projects
Description
This route is used to retrieve a list of projects with pagination and optional search capabilities.
Method
GET
Query Parameters
sort
(string): The field by which to sort the projects.page
(number): The page number of the results.limit
(number): The number of items per page.searchTerm
(string): Optional search term to filter projects.
Response
- Returns a JSON response with the list of projects or an error message.
Status Codes
200 OK
: Projects retrieved successfully.500 Internal Server Error
: Error listing projects.
Throws
- An error if request validation or project retrieval fails.
Example cURL
curl --location 'https://app.ai12z.net/api/projects' \
--header 'Authorization: Bearer <YOUR_KEY>' \
--data-urlencode 'sort=name' \
--data-urlencode 'page=1' \
--data-urlencode 'limit=10'
GET: Retrieve Project by ID
Description
This route is used to retrieve details of a specific project by its ID.
Method
GET
URL Parameters
id
(string): The ID of the project to retrieve.
Response
- Returns a JSON response with project details such as
id
,name
,image
, andcmsConnectors
.
Status Codes
200 OK
: Project retrieved successfully.500 Internal Server Error
: Error retrieving the project.
Throws
- An error if the project is not found or any other error occurs.
Example cURL
curl --location 'https://app.ai12z.net/api/projects/{id}' \
--header 'Authorization: Bearer <YOUR_KEY>'
POST: Create a Project
Description
This route is used to create a new project.
Method
POST
Request Body
Example request body:
{
"name": "Project Name",
"orgName": "Organization Name",
"orgUrl": "https://organization-url.com",
"purpose": "Purpose of the project"
}
Response
- Returns the newly created project.
Status Codes
200 OK
: Project created successfully.500 Internal Server Error
: Error creating the project.
Throws
- An error if request validation or project creation fails.
Example cURL
curl --location 'https://app.ai12z.net/api/projects' \
--header 'Authorization: Bearer <YOUR_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Project Name",
"orgName": "Organization Name",
"orgUrl": "https://organization-url.com",
"purpose": "Purpose of the project"
}'
PUT: Update a Project
Description
This route is used to update an existing project.
Method
PUT
Request Body
Example request body:
{
"id": "Project ID",
"name": "Updated Project Name",
"orgName": "Updated Organization Name",
"orgUrl": "https://updated-organization-url.com",
"purpose": "Updated Purpose of the project"
}
Response
- Returns the updated project.
Status Codes
200 OK
: Project updated successfully.500 Internal Server Error
: Error updating the project.
Throws
- An error if request validation or project update fails.
Example cURL
curl --location --request PUT 'https://app.ai12z.net/api/projects' \
--header 'Authorization: Bearer <YOUR_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "Project ID",
"name": "Updated Project Name",
"orgName": "Updated Organization Name",
"orgUrl": "https://updated-organization-url.com",
"purpose": "Updated Purpose of the project"
}'
DELETE: Delete a Project
Description
This route is used to delete an existing project.
Method
DELETE
Request Body
Example request body:
{
"id": "Project ID"
}
Response
- Returns a confirmation message indicating successful deletion.
Status Codes
200 OK
: Project deleted successfully.500 Internal Server Error
: Error deleting the project.
Throws
- An error if request validation or project deletion fails.
Example cURL
curl --location --request DELETE 'https://app.ai12z.net/api/projects' \
--header 'Authorization: Bearer <YOUR_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "Project ID"
}'