name required | string The user defined name of the context. |
required | object or object |
{- "name": "string",
- "owner": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "type": "organization"
}
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "created_at": "2015-09-21T17:29:21.042Z"
}
List all contexts for an owner.
owner-id | string <uuid> The unique ID of the owner of the context. Specify either this or owner-slug. |
owner-slug | string A string that represents an organization. Specify either this or owner-id. Cannot be used for accounts. |
owner-type | string Enum: "account" "organization" The type of the owner. Defaults to "organization". Accounts are only used as context owners in server. |
page-token | string A token to retrieve the next page of results. |
const request = require('request'); const options = { method: 'GET', url: 'https://circleci.com/api/v2/context', qs: { 'owner-id': 'c65b68ef-e73b-4bf2-be9a-7a322a9df150', 'page-token': 'NEXT_PAGE_TOKEN' }, headers: {'Circle-Token': 'CIRCLE_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "created_at": "2015-09-21T17:29:21.042Z"
}
], - "next_page_token": "string"
}