Octopus supports searching for many types of resources across the entire system via the search API.
Search for resources across all accessible spaces
GET /api
Query Parameters
inContainerIdstring
Optional space or project ID, determined by InContainerKind, to restrict the search results to.inContainerKindstring
Whether the search runs inside a space or a project.scopeToTypestring
Optional resource type to restrict the search to. When omitted, every type available is searched.searchTermstring
A search term to search for.
Optional if the search is scoped with ScopeToType and/or InContainerId, required otherwise.
Response
200 — The results of a global cross-space search.
Countsarray of object
The total number of matches for each resource type searched.TotalCountinteger
The number of matches for this type, capped at 100.TotalCountIsCappedboolean
True when there were 100 or more matches for this type.Typestring
The resource type this count applies to.
Resultsarray of object
The resources that matched the search query.EnvironmentKindstring
When Type is Environment, this is the specific type of environment being referred to. Omitted otherwise.Idstring
The ID of the found resource. Minimum length 1.LocationobjectNamestring
The display name of the found resource. Minimum length 1.Typestring
The type of the found resource.
Example Response
JSON
{
"Counts": [
{
"TotalCount": 28,
"TotalCountIsCapped": false,
"Type": "Runbook"
}
],
"Results": [
{
"EnvironmentKind": "Static",
"Id": "Runbooks-12",
"Location": {
"Kind": "Project",
"ProjectId": "Projects-22",
"ProjectName": "Web App",
"SpaceId": "Spaces-1",
"SpaceName": "Default"
},
"Name": "Provision Ephemeral Environment",
"Type": "Runbook"
}
]
}Lists spaces/projects to scope a search to
GET /api
Query Parameters
containerSearchTermstring
The search term to match returned space and project names against.
If omitted, everything is included.
Response
200 — Lists spaces and projects available to scope a search to.
Resultsarray of object
Up to 20 spaces followed by up to 20 projects matching the container search term.Kindstring
Whether a matched container is a space or a project.ProjectIdstring
The ID of a matched project, set only when Kind is Project.ProjectNamestring
The display name of a matched project, set only when Kind is Project.SpaceIdstring
The ID of a matched space, or of the space a matched project lives within.SpaceNamestring
The display name of a matched space, or of the space a matched project lives within. Minimum length 1.
Example Response
JSON
{
"Results": [
{
"Kind": "Project",
"ProjectId": "Projects-22",
"ProjectName": "Web App",
"SpaceId": "Spaces-1",
"SpaceName": "Default"
}
]
}