Creates a Resource for a Schedule.
V10 Endpoint
This endpoint is only supported by v10 schedules. The schedule type can be identified by querying the /schedules/{scheduleId} endpoint.
Resource Types
Resources are divided into 4 main types.
- Equipment
- Human
- Location
- Material
Operation
Operations, also known as LROs (Long Running Operations), are time-consuming tasks that would not be completed in the appropriate timeframe for a single request response. Endpoints that use operations return an operation id that can be used on a separate endpoint to track the progress of the task that is being handled.
Authentication
Requires Authorization header with valid Bearer token for scope itwin-platform.
For more documentation on authorization and how to get access token visit OAUTH2 Authorization page.
Rate limits
All iTwin Platform API operations have a rate limit. For more documentation on that visit Rate limits and quotas page.
Request parameters
The unique identifier of the Schedule.
Request headers
OAuth access token with itwin-platform scope
Setting to application/vnd.bentley.itwin-platform.v1+json is recommended.
Request body
Resource Create Request
The description of the resource.
The unique identifier of a Calendar to assign to resource.
An email address associated with the resource. Only allowed for resources of Human type.
The unique identifier of the Resource.
The name of the Resource.
The unique identifier of the parent Resource.
A URL associated with the Resource.
A unique Resource Id defined by the user.
Example
{ "description": "A box", "email": "", "id": "385c7013-1fb9-4ee5-92a9-4af73a0c5a29", "name": "Box 1", "parentId": null, "type": "Material", "url": "https://example.com", "userDefinedId": "Custom Id 001" }
Response 201 Created
Created
{ "resource": { "calendarId": "064fa960-a029-4ca7-9709-041f3bdb58eb", "deleted": false, "description": "A box", "email": "", "id": "385c7013-1fb9-4ee5-92a9-4af73a0c5a29", "leadTime": 0, "name": "Box 1", "parentId": null, "renewable": false, "ruleId": null, "type": "Material", "unitType": "Unknown", "url": "https://example.com", "userDefinedId": "Custom Id 001", "wholeUnits": true } }
Response headers
A header that identifies a specific version of a resource or resource collection. For more information see the official documentation.
A header that identifies the location of a specific resource. For more information see the official documentation.
The unique identifier of the Operation.
URL to the Operations endpoint with pre-entered Operation ID.
Response 202 Accepted
This response indicates that the requested long-running operation was Accepted.
{ "operation": { "id": "1604789f-68c4-46ba-b20d-8a19f8319362" }, "resource": { "id": "385c7013-1fb9-4ee5-92a9-4af73a0c5a29" }, "_links": { "operationLocation": { "href": "https://api.bentley.com/schedules/5e11b21e-cba2-48a8-a2c1-2977d2d373e0/operations/1604789f-68c4-46ba-b20d-8a19f8319362" } } }
Response headers
The unique identifier of the Operation.
URL to the Operations endpoint with pre-entered Operation ID.
Response 400 Bad Request
The 400 (Bad Request) status code indicates that the request cannot be processed by the server due to a client error (e.g. malformed request syntax)
{ "error": { "code": "InvalidSchedulesRequest", "details": [{ "code": "InvalidValue", "message": "Provided 'calendarId' value is not valid. Requested Calendar is not available.", "target": "calendarId" }], "message": "The request contains invalid properties." } }
Response 401 Unauthorized
This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.
{ "error": { "code": "HeaderNotFound", "message": "Header Authorization was not found in the request. Access denied." } }
Response 403 Forbidden
User is not authorized to create a Resource.
{ "error": { "code": "InsufficientPermissions", "message": "The user has insufficient permissions for the requested operation." } }
Response 404 Not Found
This response indicates that the provided Schedule is not available.
{ "error": { "code": "ScheduleNotFound", "message": "Requested Schedule is not available.", "target": "scheduleId" } }
Response 409 Conflict
Indicates that the entity being created conflicts with an existing one.
{ "error": { "code": "ResourceExists", "message": "Resource with provided Id already exists." } }
Response 429 Too many requests
This response indicates that the client sent more requests than allowed by this API for the current tier of the client.
{ "error": { "code": "RateLimitExceeded", "message": "The client sent more requests than allowed by this API for the current tier of the client." } }
Response headers
Number of seconds to wait until client is allowed to make more requests.
Link
Hyperlink container.
Hyperlink to the specific entity.
{ "type": "object", "properties": { "href": { "type": "string", "description": "Hyperlink to the specific entity." } }, "additionalProperties": false, "description": "Hyperlink container." }
Operation Create Response Properties
Contains the id of the created long-running operation.
The unique identifier of the Operation.
{ "title": "Operation Create Response Properties", "type": "object", "properties": { "id": { "type": "string", "description": "The unique identifier of the Operation.", "nullable": true } }, "additionalProperties": false, "description": "Contains the id of the created long-running operation." }
Operation Location
Contains the URL to the Operations endpoint to check the information about a long-running operation.
{ "title": "Operation Location", "type": "object", "properties": { "operationLocation": { "$ref": "#/components/schemas/Link", "description": "URL to the Operations endpoint with pre-entered Operation ID." } }, "additionalProperties": false, "description": "Contains the URL to the Operations endpoint to check the information about a long-running operation." }
Resource
Representation of a Resource.
The unique identifier of the Calendar.
Is this Resource deleted.
The description of the resource.
An email address associated with the resource. Only allowed for resources of Human type.
The unique identifier of the Resource.
The notification period required prior to supply the Resource. The value is a timestamp of seconds.
The name of the Resource.
The unique identifier of the parent Resource.
A Renewable Resource will be released after the Task completion and can be reused on another Task. The available quantity of a non-renewable Resource decreases as it is used up by the Task.
The unique identifier of the Rule.
The type of units that are used to describe the resource. Only available for resources of Material and Location type.
A URL associated with the Resource.
A unique Resource Id defined by the user.
A boolean value specifying whether the resource units must be in whole numbers.
{ "title": "Resource", "type": "object", "properties": { "calendarId": { "type": "string", "description": "The unique identifier of the Calendar.", "nullable": true }, "deleted": { "type": "boolean", "description": "Is this Resource deleted.", "nullable": true }, "description": { "type": "string", "description": "The description of the resource." }, "email": { "type": "string", "description": "An email address associated with the resource. Only allowed for resources of Human type." }, "id": { "type": "string", "description": "The unique identifier of the Resource." }, "leadTime": { "type": "integer", "description": "The notification period required prior to supply the Resource. The value is a timestamp of seconds.", "format": "int32" }, "name": { "type": "string", "description": "The name of the Resource." }, "parentId": { "type": "string", "description": "The unique identifier of the parent Resource.", "nullable": true }, "renewable": { "type": "boolean", "description": "A Renewable Resource will be released after the Task completion and can be reused on another Task. The available quantity of a non-renewable Resource decreases as it is used up by the Task." }, "ruleId": { "type": "string", "description": "The unique identifier of the Rule.", "nullable": true }, "type": { "$ref": "#/components/schemas/ResourceType", "description": "The type of the Resource." }, "unitType": { "$ref": "#/components/schemas/ResourceUnitType", "description": "The type of units that are used to describe the resource. Only available for resources of Material and Location type." }, "url": { "type": "string", "description": "A URL associated with the Resource.", "nullable": true }, "userDefinedId": { "type": "string", "description": "A unique Resource Id defined by the user.", "nullable": true }, "wholeUnits": { "type": "boolean", "description": "A boolean value specifying whether the resource units must be in whole numbers." } }, "additionalProperties": false, "description": "Representation of a Resource." }
Resource Create Response
Contains properties of the created long-running operation, and a link to this operation.
Contains properties of the created long-running operation.
Contains the hyperlink to the Operations endpoint to check the operation information.
{ "title": "Resource Create Response", "type": "object", "properties": { "operation": { "$ref": "#/components/schemas/OperationCreateResponseProperties", "description": "Contains properties of the created long-running operation.", "nullable": true }, "resource": { "$ref": "#/components/schemas/ResourceResponseProperties", "description": "Properties of the Resource to be created." }, "_links": { "$ref": "#/components/schemas/OperationLocationLink", "description": "Contains the hyperlink to the Operations endpoint to check the operation information.", "nullable": true } }, "additionalProperties": false, "description": "Contains properties of the created long-running operation, and a link to this operation.", "x-codegen-extends-class": "OperationCreateResponse" }
Resource Response Properties
Contains properties of the Resource that is queued for an action.
The unique identifier of the Resource.
{ "title": "Resource Response Properties", "type": "object", "properties": { "id": { "type": "string", "description": "The unique identifier of the Resource." } }, "additionalProperties": false, "description": "Contains properties of the Resource that is queued for an action." }
Resource Create Request
Properties of the Resource to be created.
The description of the resource.
The unique identifier of a Calendar to assign to resource.
An email address associated with the resource. Only allowed for resources of Human type.
The unique identifier of the Resource.
The name of the Resource.
The unique identifier of the parent Resource.
A URL associated with the Resource.
A unique Resource Id defined by the user.
{ "title": "Resource Create Request", "type": "object", "properties": { "description": { "type": "string", "description": "The description of the resource.", "nullable": true }, "calendarId": { "type": "string", "description": "The unique identifier of a Calendar to assign to resource.", "nullable": true }, "email": { "type": "string", "description": "An email address associated with the resource. Only allowed for resources of Human type.", "nullable": true }, "id": { "type": "string", "description": "The unique identifier of the Resource." }, "name": { "type": "string", "description": "The name of the Resource." }, "parentId": { "type": "string", "description": "The unique identifier of the parent Resource.", "nullable": true }, "type": { "$ref": "#/components/schemas/ResourceType", "description": "The type of the Resource." }, "url": { "type": "string", "description": "A URL associated with the Resource.", "nullable": true }, "userDefinedId": { "type": "string", "description": "A unique Resource Id defined by the user.", "nullable": true } }, "additionalProperties": false, "description": "Properties of the Resource to be created." }
Resource Create Response
Contains properties of the created Resource.
Contains properties of the created long-running operation.
Contains the hyperlink to the Operations endpoint to check the operation information.
{ "title": "Resource Create Response", "type": "object", "properties": { "operation": { "$ref": "#/components/schemas/OperationCreateResponseProperties", "description": "Contains properties of the created long-running operation.", "nullable": true }, "resource": { "$ref": "#/components/schemas/Resource" }, "_links": { "$ref": "#/components/schemas/OperationLocationLink", "description": "Contains the hyperlink to the Operations endpoint to check the operation information.", "nullable": true } }, "additionalProperties": false, "description": "Contains properties of the created Resource." }
Resource Type
The type of a Resource.
{ "title": "Resource Type", "enum": [ "Material", "Location", "Equipment", "Human", "Unknown" ], "type": "string", "description": "The type of a Resource." }
Resource Unit Type
The possible unit types for resources.
{ "title": "Resource Unit Type", "enum": [ "CubicFeet", "CubicMeter", "Liter", "Millimeter", "Meter", "Feet", "Each", "Pair", "Dozen", "Gross", "SqFoot", "SqYard", "SqMeter", "Pound", "Gram", "Kilo", "Bag", "Box", "Bucket", "Bundle", "Card", "Carton", "Coil", "Pack", "Pegs", "Length", "Outer", "Pallet", "Roll", "Sachet", "Set", "Sheet", "Ton", "Person", "Item", "CubicYard", "MetricTon", "Hour", "LinearMeter", "Unknown" ], "type": "string", "description": "The possible unit types for resources." }
DetailedError
Contains error information and an array of more specific errors.
One of a server-defined set of error codes.
A human-readable representation of the error.
The target of the error.
{ "type": "object", "description": "Contains error information and an array of more specific errors.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error.", "nullable": true }, "details": { "type": "array", "description": "Optional array of more specific errors.", "items": { "$ref": "#/components/schemas/Error" } } }, "required": [ "code", "message", "details" ], "additionalProperties": true }
Detailed Error Response
Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.
{ "type": "object", "title": "Detailed Error Response", "description": "Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.", "properties": { "error": { "description": "Error Detailed information.", "$ref": "#/components/schemas/DetailedError" } }, "required": [ "error" ], "additionalProperties": false }
Error
Contains error information.
One of a server-defined set of error codes.
A human-readable representation of the error.
The target of the error.
{ "type": "object", "description": "Contains error information.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error.", "nullable": true } }, "required": [ "code", "message" ], "additionalProperties": true }
Error Response
Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.
{ "type": "object", "title": "Error Response", "description": "Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.", "properties": { "error": { "description": "Error information.", "$ref": "#/components/schemas/Error" } }, "required": [ "error" ], "additionalProperties": false }