Create/Update Program (upsert)
An overview of the Create/Update Program endpoint.
Endpoint Description
This endpoint allows you to create or update a company location.
HTTP Method
POST /api/v2/programs/{companyId}
Request
Headers:
Content-Type:
application/json- Specifies that the request body format is JSON.Accept:
application/json- Indicates that the client expects a JSON response.Authorization:
Bearer {token}- A valid Bearer token must be provided to authenticate the request.
URL Parameters
id (integer, required): The id of the company (subscription) to create or update Program data. Example: 1234
Query Parameters:
id (integer, optional): The id of the program to update. Leaving this field blank will create a new program under the specified company. Example: 1234
name (string, required): The name of the program. Example: New Program
parent_id (integer, required): The id of the program parent for alignment of the new/existing program. The id can be retrieved with the List Parent Programs endpoint. Example: 1234
status (string, required): The status of the program (published, pending, draft). Example: published
Request Examples
Response
Data Dictionary:
id (Integer): The unique identifier for the program within the R1 Discover system.
company_id (Integer): The unique identifier for the company within the R1 Discover system.
name (string): The name of the program.
program_parent_id (integer): The id of the program parent.
status (string): The status of the program (published, pending, draft)
created_at (date): The creation date for the company program.
updated_at (date): The date the company program was last updated.
Response Examples
Postman Link
Notes
Authorization Required: Ensure the provided Bearer token is valid and has sufficient privileges to access the endpoint.
Last updated
