Required permission:
- ticket.agent or admin.organization (can read all organizations)
- any (can only read its own organization if exists)
Request:
GET /api/v1/organizations
Response:
Status: 200 Ok [ { "id": 123, "name": "Org 1", "shared": true, "active": true, "note": "some note", "updated_at": "2016-08-16T07:55:42.119Z", "created_at": "2016-08-16T07:55:42.119Z" }, { "id": 124, "name": "Org 2", "shared": false, "active": true, "note": "some note", "updated_at": "2016-08-16T07:55:42.119Z", "created_at": "2016-08-16T07:55:42.119Z" }, ]
Required permission:
- ticket.agent or admin.organization (can read all organization)
Request:
GET /api/v1/organizations/search?query=what&limit=10
Note: As of Zammad 2.6 parameters (sort_by=some_row and order_by=asc or desc) can also be used for sorting.
Response:
Status: 200 Ok [ { "id": 123, "name": "Org 1", "shared": true, "active": true, "note": "some note", "updated_at": "2016-08-16T07:55:42.119Z", "created_at": "2016-08-16T07:55:42.119Z" }, { "id": 124, "name": "Org 2", "shared": false, "active": true, "note": "some note", "updated_at": "2016-08-16T07:55:42.119Z", "created_at": "2016-08-16T07:55:42.119Z" }, ]
Required permission:
- ticket.agent or admin.organization (can read all organizations)
- any (can only read its own user if exists)
Request:
GET /api/v1/organizations/{id}
Response:
Status: 200 Ok { "id": 123, "name": "Org 1", "shared": true, "active": true, "note": "some note", "updated_at": "2016-08-16T07:55:42.119Z", "created_at": "2016-08-16T07:55:42.119Z" }
Required permission:
- admin.organization
Request:
POST /api/v1/organizations { "name": "Org 1", "shared": true, "active": true, "note": "some note" }
Response:
Status: 201 Created { "id": 123, "name": "Org 1", "shared": true, "active": true, "note": "some note", "updated_at": "2016-08-16T07:55:42.119Z", "created_at": "2016-08-16T07:55:42.119Z" }
Required permission:
- admin.organization
Request:
PUT /api/v1/organizations/{id} { "id": 123, "name": "Org 1", "shared": true, "active": true, "note": "some note" }
Response:
Status: 200 Ok { "id": 123, "name": "Org 1", "shared": true, "active": true, "note": "some note", "updated_at": "2016-08-16T07:55:42.119Z", "created_at": "2016-08-16T07:55:42.119Z" }
Required permission:
- admin.organization (only if no references in history tables and tickets exist)
Request:
DELETE /api/v1/organization/{id}
Response:
Status: 200 Ok {}