POST/v1/resources/move

Assign or unassign explicitly selected resources atomically

Requires EDIT permission for every selected resource type. Moves only the selected resources; rejects broken variable references, name conflicts and cross-project maintenance targets without partial changes.

Requires PROJECTS:EDIT.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Body parameters

project_id:string | null
Project ID, or null for unassigned.
resources:object[]

Responses

StatusMeaningDescription
200OKMoved selection and destination
400Bad RequestInvalid request
401UnauthorizedMissing or invalid credentials
403ForbiddenInsufficient permissions
404Not FoundResource or project not found
409ConflictMove would break variable references, create a name conflict, or separate maintenance windows from their targets
500Internal Server ErrorInternal server error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

POST
/v1/resources/move
curl --request POST \
  --url https://api.onlineornot.com/v1/resources/move \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"project_id":"a1b2c3d4e5f6g7h8","resources":[{"kind":"check","id":"string"}]}'

Response

{
  "result": {
    "project_id": "a1b2c3d4e5f6g7h8",
    "resources": [
      {
        "kind": "check",
        "id": "string"
      }
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}

POST/v1/projects

Create a project

Requires PROJECTS:EDIT.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Body parameters

name:string
Project name. Unique within the organisation, ignoring case and surrounding spaces.

Responses

StatusMeaningDescription
201CreatedProject created
400Bad RequestInvalid request
401UnauthorizedMissing or invalid credentials
403ForbiddenInsufficient permissions
409Conflictproject_name_taken
429Too Many RequestsRate limit exceeded
500Internal Server ErrorInternal server error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

POST
/v1/projects
curl --request POST \
  --url https://api.onlineornot.com/v1/projects \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"name":"staging"}'

Response

{
  "result": {
    "id": "a1b2c3d4e5f6g7h8",
    "name": "staging",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  },
  "success": true,
  "errors": [],
  "messages": []
}

GET/v1/projects

List projects

Requires PROJECTS:READ.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Query parameters

page:integeroptional
Page number of paginated results, starting at 1.
Default: 1
per_page:integeroptional
Number of items per page. Defaults to 20. Continue requesting subsequent pages until the accumulated item count reaches result_info.total_count or a page is empty.
Default: 20

Responses

StatusMeaningDescription
200OKPaginated owned projects
400Bad RequestInvalid request
401UnauthorizedMissing or invalid credentials
403ForbiddenInsufficient permissions
429Too Many RequestsRate limit exceeded
500Internal Server ErrorInternal server error

Response Schema

result:object[]
result_info:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/projects
curl --request GET \
  --url https://api.onlineornot.com/v1/projects \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": [
    {
      "id": "a1b2c3d4e5f6g7h8",
      "name": "staging",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "result_info": {
    "page": 1,
    "per_page": 20,
    "count": 1,
    "total_count": 1
  },
  "success": true,
  "errors": [],
  "messages": []
}

GET/v1/projects/{project_id}

Get a project

Requires PROJECTS:READ.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Path parameters

project_id:string
Project ID.

Responses

StatusMeaningDescription
200OKOwned project
400Bad RequestInvalid request
401UnauthorizedMissing or invalid credentials
403ForbiddenInsufficient permissions
404Not FoundProject not found
429Too Many RequestsRate limit exceeded
500Internal Server ErrorInternal server error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/projects/{project_id}
curl --request GET \
  --url https://api.onlineornot.com/v1/projects/a1b2c3d4e5f6g7h8 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "id": "a1b2c3d4e5f6g7h8",
    "name": "staging",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  },
  "success": true,
  "errors": [],
  "messages": []
}

PATCH/v1/projects/{project_id}

Rename a project

Requires PROJECTS:EDIT.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Path parameters

project_id:string
Project ID.

Body parameters

name:string
Project name. Unique within the organisation, ignoring case and surrounding spaces.

Responses

StatusMeaningDescription
200OKRenamed project
400Bad RequestInvalid request
401UnauthorizedMissing or invalid credentials
403ForbiddenInsufficient permissions
404Not FoundProject not found
409Conflictproject_name_taken
429Too Many RequestsRate limit exceeded
500Internal Server ErrorInternal server error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

PATCH
/v1/projects/{project_id}
curl --request PATCH \
  --url https://api.onlineornot.com/v1/projects/a1b2c3d4e5f6g7h8 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"name":"staging"}'

Response

{
  "result": {
    "id": "a1b2c3d4e5f6g7h8",
    "name": "staging",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  },
  "success": true,
  "errors": [],
  "messages": []
}

DELETE/v1/projects/{project_id}

Delete an empty project

Requires PROJECTS:EDIT.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Path parameters

project_id:string
Project ID.

Responses

StatusMeaningDescription
200OKDeleted project identity
400Bad RequestInvalid request
401UnauthorizedMissing or invalid credentials
403ForbiddenInsufficient permissions
404Not FoundProject not found
409Conflictproject_not_empty
429Too Many RequestsRate limit exceeded
500Internal Server ErrorInternal server error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

DELETE
/v1/projects/{project_id}
curl --request DELETE \
  --url https://api.onlineornot.com/v1/projects/a1b2c3d4e5f6g7h8 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "id": "a1b2c3d4e5f6g7h8"
  },
  "success": true,
  "errors": [],
  "messages": []
}

Was this page helpful?