openapi: 3.2.0 info: version: 1.0.0 x-logo: url: https://developers.unqork.io/unqork-logo.png backgroundColor: '#FFFFFF' title: Unqork Customer Promotions API description: "\nUnqork's customer REST API, based on open standards, allows you to set and retrieve module submission data, as well as control other aspects of your Unqork environment. You can use any web development language to access the API, as communication is over secured HTTP.\n## URI Structure and Methods\nAll API communication will occur over SSL (HTTPS). All API responses are in JSON format.\nAll Unqork requests begin with the prefix:\n\n```\n https://{yourSubdomain}.unqork.io/api/1.0\n```\n\nFor example, if your subdomain is **xyzfinancial**, you would use the prefix `https://xyzfinancial.unqork.io/api/1.0`.\n\nThe next segment of the URI path will vary based on the endpoint of the request.\n\nA given endpoint (resource) has a series of actions (methods) associated with it. The Unqork API supports these standard HTTP methods:\n\n- **GET** - retrieves data\n\n- **PUT** - updates existing data\n\n- **POST** - creates new data\n\n- **DELETE** - deletes existing data\n\nFor example, you can use the POST action on the module submission resource to create a new module submission.\n## Paging\nPaged endpoints use the [Link header](https://www.w3.org/wiki/LinkHeader). If the link header \"next\" is present, then there are more items to retrieve, and the \"next\" should be followed.\n## Cloud Storage Delivery\nUnqork exposes generated PDFs, uploaded attachments, and other file-like pieces of submission data via Cloud Storage Delivery URLs. These are signed, expiring links that allow the user to securely retrieve files stored in Unqork. Links can appear inside raw submission data, or they can be returned from PDF transform submission endpoints.\n\nThese links cannot be shared with other parties; only the user who generates the unique link (by either submitting the file or accessing the submission where the file has been saved) will be able to use that specifically generated link. This means that the user must be authenticated (either in the browser, or by passing a valid OAuth Bearer token) in order to retrieve the file.\n\nCloud Storage Delivery URLs will look like this:\n\n`https://xyzfinancial.unqork.io/fbu/files/{filePath}?signature={signature}`\n\nThe file can be retrieved by accessing the link in the browser, or like this:\n\n```\n $ curl -H \"Authorization: Bearer {access_token}\" https://xyzfinancial.unqork.io/fbu/files/{filePath}?signature={signature}\n```\n## Nomenclature\nPreviously, \"Modules\" were called \"Forms\". This nomenclature change affects all endpoints documented here in paths, request parameters, and response bodies (e.g. `forms -> modules`, `formId -> moduleId`; however, the behaviors of the endpoints are the same. The previous endpoints will continue to be supported, but they will be deprecated in the future.\n## API Access Notes\n#### Express Module and Workflow Access \nExpress Module and Workflow Access is determined by a User's Role and the Module's permissions. An Express User's Role is specified at the environment level, but can be overwritten at the Application level using Application Roles. If Module Permissions are used, the permission settings will specify what access (Read, Write, Obfuscate, or None) a User will have to the Module. Anonymous Users may also be able to access a Module if the permission settings allow it.\n#### Submission Access \nSubmission Access is determined by a User's Role, Groups, and if they are the owner of the Submission. A Submission owner is the user that created or updated the Submission. If a user is a Submission owner, Designer Administrator, or an Express Super User, the user has access to the Submission. If the User does not have access to the Module or Workflow that the Submission is associated with, then the User will not have access to the Submission. See Express Module and Workflow Access ([Express Module and Workflow Access](#express-module-workflow-access)). A User's Role Groups can also provide a User Access to a Submission. A User needs to have Intersecting Groups with the Submission Owner. Intersecting Groups means a User has a Role with a Group (Groups assigned directly to the User do not count) that is in the Submission owner's groups (the Submission owners Role Groups or the Submission owners User Groups). If a User has Intersecting Groups:\n- And the Group type is ignore role, a User that has Intersecting Groups can access the Submission.\n- And the Group type is Role descendents, a User that has Intersecting Groups and the Submission owner's Role is a descendant of the User's Role then the User can access the Submission.\n- And the Group type is own Role and descendents, a User that has Intersecting Groups and the Submission owner's Role is a descendent of the User's Role or the User's Role is the same as the Submission owner's Role then the User can access the Submission.\n" servers: - url: https://{host}/api/1.0 variables: host: default: env.unqork.io description: Environment host security: - OAuth2: [] tags: - name: Promotions description: ' The following endpoints are available to "Administrator" users and users with the "Promote" permission for the resource. ' paths: /promote/hosts: get: tags: - Promotions summary: Promotion Hosts operationId: getPromotionHosts description: "Returns list of environments authorized for promotion\n### Authorization Required:\n - Application Promote or Style Promote or Data Collections Promote\n" responses: '200': description: Hosts Loaded content: application/json: schema: $ref: '#/components/schemas/PromotionHosts' default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' /promote/module: post: tags: - Promotions summary: Promote Module operationId: promoteModule description: "Promote a specific module\n### Authorization Required:\n - Application Promote\n" requestBody: content: application/json: schema: $ref: '#/components/schemas/PromotionModuleExecuteRequest' responses: '204': description: Job Executed default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' /promote/referenceData: post: tags: - Promotions summary: Promote Reference Data operationId: promoteDataCollection description: "Promote a collection of reference data\n### Authorization Required:\n - Data Collections Promote\n" requestBody: content: application/json: schema: $ref: '#/components/schemas/PromotionReferenceDataExecuteRequest' responses: '204': description: Job Executed default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' /promote/applicationByItems: post: tags: - Promotions summary: Promote Application by items operationId: promoteApplicationByItems description: "Promote a specific application with Modules, Workflows, Data Schemas, Data Collections, Module Archives, or Workflow Archives\n### Authorization Required:\n - Application Promote\n" requestBody: content: application/json: schema: $ref: '#/components/schemas/PromotionApplicationByItemExecuteRequest' responses: '200': description: Job Execution Initiated. default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' /promote/style: post: tags: - Promotions summary: Promote Style operationId: promoteStyle description: "Promote a specific Style\n### Authorization Required:\n - Style Promote\n" requestBody: content: application/json: schema: $ref: '#/components/schemas/PromotionStyleExecuteRequest' responses: '204': description: Job Executed default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' /promote/groups: post: tags: - Promotions summary: Promote Groups operationId: promoteGroups description: "Promote specific groups or all groups\n### Authorization Required:\n - Designer Administrator\n" requestBody: content: application/json: schema: $ref: '#/components/schemas/PromotionGroupExecuteRequest' responses: '204': description: Job Executed default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' /promote/roles: post: tags: - Promotions summary: Promote Roles operationId: promoteRoles description: "Promote all roles\n### Authorization Required:\n - Designer Administrator\n" requestBody: content: application/json: schema: $ref: '#/components/schemas/PromotionRoleExecuteRequest' responses: '204': description: Job Executed default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' components: schemas: PromotionReferenceDataExecuteRequest: type: object required: - clientName - clientLevel - collectionName properties: clientName: type: string description: Target environment name clientLevel: type: string description: Level of the environment (qa, uat, production, etc.) collectionName: description: Name of the reference data collection to promote type: string PromotionModuleExecuteRequest: type: object required: - clientName - clientLevel - moduleId properties: clientName: type: string description: Target environment name clientLevel: type: string description: Level of the environment (qa, uat, production, etc.) moduleId: description: ID of module to Promote type: string PromotionRoleExecuteRequest: type: object required: - clientName - clientLevel properties: clientName: type: string description: Target environment name clientLevel: type: string description: Level of the environment (qa, uat, production, etc.) PromotionHosts: type: array items: type: object properties: clientName: type: string description: Target environment name clientLevel: type: string description: Level of the environment (qa, uat, production, etc.) isProduction: type: boolean description: 'Whether the host is a production environment or not NOTE: This will be true for preprod environments ' Error: type: object description: Error required: - code - message properties: code: description: HTTP status code type: integer format: int32 enum: - 400 - 401 - 403 - 404 - 412 - 500 message: description: Error message type: string PromotionApplicationByItemExecuteRequest: type: object required: - clientName - clientLevel - applicationId properties: clientName: type: string description: Target environment name clientLevel: type: string description: Level of the environment (qa, uat, production, etc.) applicationId: description: applicationId of the application to promote type: string modules: description: Array of Modules to Promote type: array items: type: string example: - moduleId1 - moduleId2 referenceDataCollections: description: Array of Reference Data Collections to Promote type: array items: type: string example: - collectionName1 - collectionName2 moduleArchives: description: 'Array of Module Archives to Promote. Must include the moduleId ' type: array items: type: object required: - moduleId - archiveId properties: moduleId: type: string description: ID of the Module whose archive needs to be promoted archiveId: type: string description: Archive Id of the Module example: moduleId: moduleId archiveId: archiveId of the Module workflowArchives: description: Array of Workflow Archives to Promote type: array items: description: Archive Id of the Workflow type: string example: - workflowArchiveId1 - workflowArchiveId2 workflows: description: Array of Workflows to Promote type: array items: type: string example: - workflowId1 - workflowId2 dataSchemaIds: description: Array of Data Schemas to Promote type: array items: type: string example: - dataSchemaId1 - dataSchemaId2 dataModels: description: Array of Data Models to Promote type: array items: type: string example: - dataModelId1 - dataModelId2 schemas: description: Array of Data Model Schemas to Promote type: array items: type: string example: - schemaId1 - schemaId2 searchConfigs: description: Array of Queries to Promote type: array items: type: string example: - queryId1 - queryId2 PromotionGroupExecuteRequest: type: object required: - clientName - clientLevel properties: clientName: type: string description: Target environment name clientLevel: type: string description: Level of the environment (qa, uat, production, etc.) groupNames: description: Names of the groups to promote type: array items: type: string PromotionStyleExecuteRequest: type: object required: - clientName - clientLevel - styleName properties: clientName: type: string description: Target environment name clientLevel: type: string description: Level of the environment (qa, uat, production, etc.) styleName: description: Style name of the style to promote type: string securitySchemes: OAuth2: description: "The Unqork API implements the [OAuth 2.0 Client Credentials Grant](https://datatracker.ietf.org/doc/html/rfc6749#section-1.3.4) and the [OAuth 2.0 Password Grant](https://tools.ietf.org/html/rfc6749#section-1.3.3). Access via OAuth2 Client Credentials Grant can be utilized by creating Client Credentials through the API Access Management Administration page. Access via OAuth2 Password Grant can be enabled for all users in Environment Administration. Once OAuth2 Password Grant is enabled, all Unqork users can use their Unqork username/password to retrieve an access token.\n\nIn order to utilize any of the API resources, you must first retrieve an access token by POSTing your credentials to the access token URL, e.g. using `curl`:\n```\n $ curl -u '{clientId}:{clientSecret}' -X POST --basic https://xyzfinancial.unqork.io/api/1.0/oauth2/access_token -d \"grant_type=client_credentials\"\n```\nOr:\n```\n $ curl -X POST https://xyzfinancial.unqork.io/api/1.0/oauth2/access_token -d \"grant_type=password&username={username}&password={password}\"\n```\nThis returns an \"access_token\", which you would then retain and use in any subsequent resource requests. **Access tokens expire after one hour, at which point you must retrieve a new one.** The access token should be included in a request header:\n```\n $ curl -H \"Authorization: Bearer {access_token}\" https://xyzfinancial.unqork.io/api/1.0/{endpoint}\n```\n" type: oauth2 flows: clientCredentials: tokenUrl: https://xyzfinancial.unqork.io/api/1.0/oauth2/access_token scopes: none: N/A password: tokenUrl: https://xyzfinancial.unqork.io/api/1.0/oauth2/access_token scopes: none: N/A