#%RAML 1.0 title: Warp Studio Organization API version: v1 baseUri: https://app.warp.studio/api/organization mediaType: application/json securitySchemes: access_token: description: Secures the API with a secret key belonging to your organization type: x-custom describedBy: headers: "X-ApiKey": description: The organization's API key type: string responses: 403: description: Missing or invalid key securedBy: [ access_token ] types: Organization: type: object properties: id: integer name: string User: type: object properties: id: integer firstname: string lastname: string email: string employee_nr: string locale: string role: string group_ids: integer[] last_sign_in_at: datetime last_attempt_at: datetime Group: type: object properties: id: integer name: string start_date: date end_date: date scenario_ids: integer[] course_ids: integer[] created_at: datetime Attempt: type: object properties: id: integer user_id: integer scenario_id: integer started_at: datetime duration: integer finished: boolean testing: boolean stars: integer Scenario: type: object properties: id: integer name: string Course: type: object properties: id: integer name: string purchased: boolean Device: type: object properties: id: integer name: string registration: string group_ids: integer[] /organization: get: displayName: Get organization description: Retrieves the current organization responses: 200: body: application/json: type: Organization /courses: get: displayName: List courses description: Retrieves the list of courses responses: 200: body: application/json: type: Course /users: get: displayName: Get users description: Retrieves the list of users responses: 200: body: application/json: type: User[] post: displayName: Create user description: | Creates a new user. New users will always be given the role of trainee. If assigned to group(s) with scenario access, an email will be send with instructions. body: application/json: type: object properties: firstname: string lastname: string email: string employee_nr: string locale: string group_ids: integer[] responses: 201: body: application/json: type: User 400: description: Validation failed /{user_id}: get: displayName: Get user description: Retrieves a user uriParameters: user_id: description: The ID of the user type: integer responses: 200: body: application/json: type: User 404: description: User not found or not allowed to retrieve put: displayName: Update user's groups description: | Add or remove user from groups. Removing a user from a group can result in scenario access being revoked. If new scenario access is granted, an email will be send with instructions. body: application/json: type: object properties: group_ids: description: The list of groups to replace the existing list of groups. type: integer[] responses: 200: body: application/json: type: User delete: displayName: Remove user description: Removes the user from the organization. Access to scenarios from this organization will be revoked. responses: 204: description: No content /groups: get: displayName: Get groups description: Retrieves the list of groups responses: 200: body: application/json: type: Group[] post: displayName: Create group description: Create a new group body: application/json: type: object properties: name: description: Name of the group type: string start_date: description: Start date of the group type: date end_date: description: End date of the group type: date scenario_ids: description: List of scenarios in group type: integer[] course_ids: description: List of courses in group type: integer[] responses: 200: body: application/json: type: Group /{group_id}: get: displayName: Get group description: Retrieve a single group uriParameters: group_id: description: The ID of the group type: integer responses: 200: body: application/json: type: Group 404: description: Group not found or not allowed to retrieve put: displayName: Update group description: Update a single group uriParameters: group_id: description: The ID of the group type: integer body: application/json: type: object properties: name: description: Name of the group type: string start_date: description: Start date of the group type: date end_date: description: End date of the group type: date scenario_ids: description: List of scenarios in group type: integer[] course_ids: description: List of courses in group type: integer[] responses: 200: body: application/json: type: Group 422: description: Group invalid 404: description: Group not found or not allowed to retrieve /scenarios: get: displayName: Get scenarios description: Retrieve the list of scenarios responses: 200: body: application/json: type: Scenario[] /{scenario_id}: get: displayName: Get scenario description: Retrieve a single scenario uriParameters: scenario_id: description: The ID of the scenario type: integer responses: 200: body: application/json: type: Scenario 404: description: Scenario not found or not allowed to retrieve /devices: get: displayName: Devices description: Retrieve the list of registered devices responses: 200: body: application/json: type: Device[] /{device_id}: put: displayName: Update device description: Update a registered device uriParameters: device_id: description: The ID of the device type: integer body: application/json: type: object properties: name: description: Name of the device type: string group_ids: description: List of groups of the device type: integer[] responses: 200: body: application/json: type: Device /attempts: get: displayName: Attempts description: Retrieve the list of attempts queryParameters: started_at_since: description: Specify a timestamp. Only attempts started at or after this time are returned. Invalid timestamps are ignored. type: datetime required: false scenario_id: description: Specify a scenario ID. Only attempts for this scenario are returned. type: integer required: false user_id: description: Specify a user ID. Only attempts for this user are returned. type: integer required: false responses: 200: body: application/json: type: Attempt[]