/api/stations/v1/stations
  • 22 Aug 2024
  • 8 Minutes to read
  • Contributors

/api/stations/v1/stations


Article summary

Post
/api/stations/v1/stations

Creates a station.

Body parameters

The fields to create a station.

Expand All
object

Used to create a station.

Example{ "name": "Boston Line 1", "description": "The primary station at line 1.", "appAssignments": [ { "type": "app-folder", "tag": "latest-published", "appFolderId": "swM2aGebq5MjhKafN" } ], "stationGroupId": "78M2aGebq5MjhKafN", "timezone": "America/Denver" }
name
string Required

The name of the station.

Max length500
description
string

A short description of the station.

Max length5000
appAssignments
Array of object (GenericAppAssignment)

The station's app assignments.

object

Represents the contents of a single app assignment.

Example{ "type": "app", "tag": "development", "appId": "swM2aGebq5MjhKafN" }
OneOf
AllAppAssignment
type
string Required
Valid values[ "all" ]
Default"all"
tag
string Required

The tag of an app assignment. Determines if the app assignment refers to the development version of an app or the latest production version.

Valid values[ "development", "latest-published" ]
FolderAppAssignment
type
string Required
Valid values[ "app-folder" ]
Default"app-folder"
tag
string Required

The tag of an app assignment. Determines if the app assignment refers to the development version of an app or the latest production version.

Valid values[ "development", "latest-published" ]
appFolderId
Exampleg56RCoZCtzv7borvp
SpecificAppAssignment
type
string Required
Valid values[ "app" ]
Default"app"
tag
string Required

The tag of an app assignment. Determines if the app assignment refers to the development version of an app or the latest production version.

Valid values[ "development", "latest-published" ]
appId
Exampleg56RCoZCtzv7borvp
VersionAppAssignment
type
string Required
Valid values[ "app-version" ]
Default"app-version"
appVersionId
Exampleg56RCoZCtzv7borvp
stationGroupId
Exampleg56RCoZCtzv7borvp
timezone
string

A canonical IANA time zone identifier.

ExampleAmerica/New_York
Responses
200

The station was successfully created.

Expand All
object

Represents a station.

Example{ "id": "swM2aGebq5MjhKafN", "name": "Boston Line 1", "description": "Station for line 1 at the Boston location.", "stationGroupId": "12M453ebq5MjhKafN", "operatorId": "234M2aGebq5MjhKafN", "timezone": "America/New_York", "appExecutionState": { "stepId": "7psyeGebq5MjhKafN", "appVersionId": "58H1aGebp8DqkPaeV" }, "created": { "at": "2023-03-08T12:17:24Z", "by": { "id": "90M2aGebq5MjhKafN", "type": "user" } }, "lastModified": { "at": "2023-03-08T12:17:24Z", "by": { "id": "90M2aGebq5MjhKafN", "type": "user" } }, "workspaces": { "scope": "specific", "workspaceIds": [ "56M2aGebq5MjhKafN" ] } }
id
Exampleg56RCoZCtzv7borvp
name
string

The name of the station.

description
string

A short description of the station.

appExecutionState
object (AppExecutionState)

Contains context about a station's current app execution.

Example{ "appVersionId": "614M2uGrbq5BjhKrpQ", "stepId": "9834aGebq5MjhKafN" }
appVersionId
Exampleg56RCoZCtzv7borvp
stepId
Exampleg56RCoZCtzv7borvp
stationGroupId
Exampleg56RCoZCtzv7borvp
operatorId
Exampleg56RCoZCtzv7borvp
timezone
string

A canonical IANA time zone identifier.

ExampleAmerica/New_York
created
at
string (date-time)

A date-time string as defined by RFC 3339 §5.6.

Example2022-11-21T07:59:10Z
by
object (ActorMetadata)

Represents a user, api-token, or device.

type
string
Valid values[ "user", "api-token", "device" ]
id
Exampleg56RCoZCtzv7borvp
lastModified
at
string (date-time)

A date-time string as defined by RFC 3339 §5.6.

Example2022-11-21T07:59:10Z
by
object (ActorMetadata)

Represents a user, api-token, or device.

type
string
Valid values[ "user", "api-token", "device" ]
id
Exampleg56RCoZCtzv7borvp
archived
at
string (date-time)

A date-time string as defined by RFC 3339 §5.6.

Example2022-11-21T07:59:10Z
by
object (ActorMetadata)

Represents a user, api-token, or device.

type
string
Valid values[ "user", "api-token", "device" ]
id
Exampleg56RCoZCtzv7borvp
workspaces
object (WorkspaceMembership)

A description of the workspaces of which a resource is a member. Workspace membership can have one of two scope values. A scope of all means that a resource is a member of all current and future workspaces. A scope of the value specific means that a resource is a member of a set of particular workspaces as described by the workspaceIds property.

Example{ "scope": "specific", "workspaceIds": [ "DEFAULT" ] }
OneOf
AllWorkspacesMembership
scope
string

Describes a resource as a member of all current and future workspaces.

Valid values[ "all" ]
Exampleall
SpecificWorkspacesMembership
scope
string

Describes a resource as a member of a set of specific workspaces.

Valid values[ "specific" ]
Examplespecific
workspaceIds
Array of string (WorkspaceId)

The workspaces in which a resource is a member.

string
ExampleDEFAULT
400

An error occurred. The Tulip error codes generic.customerIdRequired, generic.workspaceIdRequired, generic.invalidParams, http.invalidBodyJson, http.invalidHeaders, and http.multiValueHeader all use the 400 HTTP status code. See the documentation of the response content schema for details on these specific Tulip errors that could result in this status code.

Expand All
OneOf
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "generic.customerIdRequired" ]
retryable
Valid values[ "False" ]
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "generic.workspaceIdRequired" ]
retryable
Valid values[ "False" ]
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "generic.invalidParams" ]
retryable
Valid values[ "False" ]
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "http.invalidBodyJson" ]
retryable
Valid values[ "False" ]
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "http.invalidHeaders" ]
retryable
Valid values[ "False" ]
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "http.multiValueHeader" ]
details
object
headerName
string

The name of the given HTTP header which had multiple values.

retryable
Valid values[ "False" ]
401

The request was missing required authentication information.

This error is not automatically retryable.

object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "generic.authRequired" ]
retryable
Valid values[ "False" ]
404

The requested resource was not found.

This error is not automatically retryable.

object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "generic.notFound" ]
retryable
Valid values[ "False" ]
409

Resource with this name already exists in the workspace.

This error is not automatically retryable.

Expand All
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "stations.resourceWithThisNameAlreadyExists" ]
details
object
name
string
type
string
retryable
Valid values[ "False" ]
422

An error occurred. The Tulip error codes generic.resourceLimitInWorkspaceReached, stations.invalidReferencedResourceId, stations.invalidResourceDescription, stations.invalidResourceName, and stations.stationGroupStationsLimitReached all use the 422 HTTP status code. See the documentation of the response content schema for details on these specific Tulip errors that could result in this status code.

Expand All
OneOf
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "generic.resourceLimitInWorkspaceReached" ]
details
object
workspaceId
string
resourceType
string
limit
number

The limit of how many resources of the type can be in the workspace.

current
number

The current number of resource of the type in the workspace.

retryable
Valid values[ "False" ]
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "stations.invalidReferencedResourceId" ]
details
Array of object

A list of invalid referenced resources.

object
resourceId
string

The id of the invalid resource.

details
string

Details about why the resource was invalid.

retryable
Valid values[ "False" ]
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "stations.invalidResourceDescription" ]
details
object
reason
string
retryable
Valid values[ "False" ]
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "stations.invalidResourceName" ]
details
object
reason
string
retryable
Valid values[ "False" ]
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "stations.stationGroupStationsLimitReached" ]
details
object
workspaceId
string
stationGroupId
string
limit
number

The limit of how many stations can be in the station group.

current
number

The current number of stations in the station group.

retryable
Valid values[ "False" ]
429

Too many requests have been made to this endpoint in a short time period.

This error is not automatically retryable.

Expand All
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "http.endpointRateLimitExceeded" ]
details
object
details
string

Additional details about this endpoint's rate limits.

retryable
Valid values[ "False" ]
500

An error occurred. The Tulip error codes generic.internal and stations.internalTypeValidationError both use the 500 HTTP status code. See the documentation of the response content schema for details on these specific Tulip errors that could result in this status code.

Expand All
OneOf
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "generic.internal" ]
retryable
Valid values[ "False" ]
object
errorCode
string

A machine-readable code identifying the type of error.

Pattern^[a-zA-Z0-9.]$
message
string

A human-readable description of the error intended for debugging purposes only.

The exact content of this message is not stable.

retryable
boolean

Whether the request can be automatically retried by the client.

errorCode
Valid values[ "stations.internalTypeValidationError" ]
details
object
resourceName
string

The name of the resource that failed validation.

resourceId
string

The id of the resource that failed validation.

retryable
Valid values[ "False" ]

Was this article helpful?