Workspace
This endpoint is used to create, update, search or delete workspace information inside a Terrakube organization.
Entity fields:
data.type
string
Should be "workspace"
data.attributes.name
string
Unique workspace for an Terrakube organization
data.attributes.branch
boolean
Git branch to be used
data.attributes.source
boolean
Git repository to be used
data.attributes.terraformVersion
boolean
Terraform version to run the workspace
data.relationships.vcs.data.type
string
Should be "vcs" (OPTIONAL)
data.relationships.vcs.data.id
string
Should be the VCS Connection Id (OPTIONAL)
data.relationships.project.data.type
string
Should be "project" (OPTIONAL)
data.relationships.project.data.id
string
Project ID to assign this workspace to (OPTIONAL)
The 2.34.0 workspace controls below default to false. Only a superuser or organization-level workspace manager can change them; see Run Restrictions.
data.attributes.restrictApplyToConfiguredBranch
boolean
Restrict apply/destroy runs to the configured branch, with source-specific checks.
data.attributes.requireApproveToApply
boolean
Require approve permission to start an apply without a preceding approval step.
Example:
{
"data": {
"type": "workspace",
"attributes": {
"branch": "main",
"name": "Terrakube Workspace",
"source": "https://github.com/terrakube-io/terraform-sample-repository.git",
"terraformVersion": "0.15.0"
},
"relationships": {
"vcs": {
"data": {
"type": "vcs",
"id": "{{vcsIdGitHub}}"
}
}
}
}
}Supported Operations
Returns an instance of type workspace
organization Identifier
workspace Identifier
Successful response
GET /api/v1/organization/{organizationId}/workspace/{workspaceId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Successful response
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"allowRemoteApply": null,
"branch": null,
"createdBy": null,
"createdDate": null,
"defaultTemplate": null,
"deleted": null,
"description": null,
"executionMode": null,
"folder": null,
"globalRemoteState": null,
"iacType": null,
"lastJobDate": null,
"lastJobStatus": null,
"lockDescription": null,
"locked": null,
"moduleSshKey": null,
"name": null,
"policyComplianceStatus": null,
"sharedIds": null,
"source": null,
"terraformVersion": null,
"updatedBy": null,
"updatedDate": null,
"restrictApplyToConfiguredBranch": false,
"requireApproveToApply": false
},
"relationships": {
"access": {
"data": [
null
]
},
"agent": {
"data": [
null
]
},
"history": {
"data": [
null
]
},
"job": {
"data": [
null
]
},
"notificationConfiguration": {
"data": [
null
]
},
"organization": {
"data": [
null
]
},
"project": {
"data": [
null
]
},
"reference": {
"data": [
null
]
},
"runTriggers": {
"data": [
null
]
},
"schedule": {
"data": [
null
]
},
"sourceRunTriggers": {
"data": [
null
]
},
"ssh": {
"data": [
null
]
},
"variable": {
"data": [
null
]
},
"vcs": {
"data": [
null
]
},
"webhook": {
"data": [
null
]
},
"workspaceTag": {
"data": [
null
]
}
}
},
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Creates an item of type workspace and adds it to workspace
organization Identifier
Successful response
POST /api/v1/organization/{organizationId}/workspace HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 1098
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"allowRemoteApply": null,
"branch": null,
"createdBy": null,
"createdDate": null,
"defaultTemplate": null,
"deleted": null,
"description": null,
"executionMode": null,
"folder": null,
"globalRemoteState": null,
"iacType": null,
"lastJobDate": null,
"lastJobStatus": null,
"lockDescription": null,
"locked": null,
"moduleSshKey": null,
"name": null,
"policyComplianceStatus": null,
"sharedIds": null,
"source": null,
"terraformVersion": null,
"updatedBy": null,
"updatedDate": null,
"restrictApplyToConfiguredBranch": false,
"requireApproveToApply": false
},
"relationships": {
"access": {
"data": [
null
]
},
"agent": {
"data": [
null
]
},
"history": {
"data": [
null
]
},
"job": {
"data": [
null
]
},
"notificationConfiguration": {
"data": [
null
]
},
"organization": {
"data": [
null
]
},
"project": {
"data": [
null
]
},
"reference": {
"data": [
null
]
},
"runTriggers": {
"data": [
null
]
},
"schedule": {
"data": [
null
]
},
"sourceRunTriggers": {
"data": [
null
]
},
"ssh": {
"data": [
null
]
},
"variable": {
"data": [
null
]
},
"vcs": {
"data": [
null
]
},
"webhook": {
"data": [
null
]
},
"workspaceTag": {
"data": [
null
]
}
}
},
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Successful response
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"allowRemoteApply": null,
"branch": null,
"createdBy": null,
"createdDate": null,
"defaultTemplate": null,
"deleted": null,
"description": null,
"executionMode": null,
"folder": null,
"globalRemoteState": null,
"iacType": null,
"lastJobDate": null,
"lastJobStatus": null,
"lockDescription": null,
"locked": null,
"moduleSshKey": null,
"name": null,
"policyComplianceStatus": null,
"sharedIds": null,
"source": null,
"terraformVersion": null,
"updatedBy": null,
"updatedDate": null,
"restrictApplyToConfiguredBranch": false,
"requireApproveToApply": false
},
"relationships": {
"access": {
"data": [
null
]
},
"agent": {
"data": [
null
]
},
"history": {
"data": [
null
]
},
"job": {
"data": [
null
]
},
"notificationConfiguration": {
"data": [
null
]
},
"organization": {
"data": [
null
]
},
"project": {
"data": [
null
]
},
"reference": {
"data": [
null
]
},
"runTriggers": {
"data": [
null
]
},
"schedule": {
"data": [
null
]
},
"sourceRunTriggers": {
"data": [
null
]
},
"ssh": {
"data": [
null
]
},
"variable": {
"data": [
null
]
},
"vcs": {
"data": [
null
]
},
"webhook": {
"data": [
null
]
},
"workspaceTag": {
"data": [
null
]
}
}
},
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Deletes an instance of type workspace
organization Identifier
workspace Identifier
Successful response
No content
DELETE /api/v1/organization/{organizationId}/workspace/{workspaceId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Successful response
No content
Modifies an instance of type workspace
organization Identifier
workspace Identifier
Successful response
No content
PATCH /api/v1/organization/{organizationId}/workspace/{workspaceId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 1098
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"allowRemoteApply": null,
"branch": null,
"createdBy": null,
"createdDate": null,
"defaultTemplate": null,
"deleted": null,
"description": null,
"executionMode": null,
"folder": null,
"globalRemoteState": null,
"iacType": null,
"lastJobDate": null,
"lastJobStatus": null,
"lockDescription": null,
"locked": null,
"moduleSshKey": null,
"name": null,
"policyComplianceStatus": null,
"sharedIds": null,
"source": null,
"terraformVersion": null,
"updatedBy": null,
"updatedDate": null,
"restrictApplyToConfiguredBranch": false,
"requireApproveToApply": false
},
"relationships": {
"access": {
"data": [
null
]
},
"agent": {
"data": [
null
]
},
"history": {
"data": [
null
]
},
"job": {
"data": [
null
]
},
"notificationConfiguration": {
"data": [
null
]
},
"organization": {
"data": [
null
]
},
"project": {
"data": [
null
]
},
"reference": {
"data": [
null
]
},
"runTriggers": {
"data": [
null
]
},
"schedule": {
"data": [
null
]
},
"sourceRunTriggers": {
"data": [
null
]
},
"ssh": {
"data": [
null
]
},
"variable": {
"data": [
null
]
},
"vcs": {
"data": [
null
]
},
"webhook": {
"data": [
null
]
},
"workspaceTag": {
"data": [
null
]
}
}
},
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Successful response
No content
Last updated
Was this helpful?