Projects
List all projects of an administration
Returns a paginated list of projects in the administration. Each page contains 25 projects. You can use the page
parameter to fetch the next page of projects. It returns the active projects when no filter is applied.
Parameters
Parameter | Type | Description |
---|---|---|
filter |
String |
The filter, can be: state:all, state:archived or state:active |
per_page |
Integer |
Amount of projects per page, default: 25 |
page |
Integer |
The page to fetch, starting at 1. |
Example: returns the list of projects
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/projects.json?
Response
Status: 200 OK
[
{
"id": "440890472675674071",
"name": "My project name",
"state": "active"
}
]
Example: returns the list of filtered archived projects
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/projects.json?filter=state%3Aarchived
Response
Status: 200 OK
[
{
"id": "440890472808843227",
"name": "Project Blackbird",
"state": "archived"
}
]
Returns information about a project
Example: returns a single project
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/projects/440890472909506526.json?
Response
Status: 200 OK
{
"id": "440890472909506526",
"name": "My project name",
"state": "active"
}
Example: returns 404 when project does not exist
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/projects/1337.json?
Response
Status: 404 Not Found
{
"error": "record not found",
"symbolic": {
"id": "not_found"
}
}
Creates a new project
Parameters
Parameter | Type | Description |
---|---|---|
project[name] |
String |
Required Should be unique for the administration. |
project[budget] |
String |
Example: creates a new project
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPOST \
-d '{"project":{"name":"Falcon"}}' \
https://moneybird.com/api/v2/123/projects.json
Response
Status: 201 Created
{
"id": "440890473191573476",
"name": "Falcon",
"state": "active"
}
Example: returns an error when information is missing
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPOST \
-d '{"project":{"name":""}}' \
https://moneybird.com/api/v2/123/projects.json
Response
Status: 422 Unprocessable Entity
{
"error": {
"name": [
"mag niet leeg zijn"
]
}
}
Updates a project
Parameters
Parameter | Type | Description |
---|---|---|
project[name] |
String |
Required Should be unique for the administration. |
project[budget] |
String |
Example: updates a project
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPATCH \
-d '{"project":{"name":"Eagle"}}' \
https://moneybird.com/api/v2/123/projects/440890473339422696.json
Response
Status: 200 OK
{
"id": "440890473339422696",
"name": "Eagle",
"state": "active"
}
Deletes a project
Deletes a project. When there are no linked entities (sales invoices, estimates, etc.) the project is deleted. When there are linked entities, the project gets the state archived
.
Example: deletes a project without a linked entity
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XDELETE \
-d '{}' \
https://moneybird.com/api/v2/123/projects/440890473469446123.json
Response
Example: archives a project with a linked entity
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XDELETE \
-d '{}' \
https://moneybird.com/api/v2/123/projects/440890473592129518.json