Restore integration to last successful mapping
POST/v1/integration/:integration_id/restore
This route restores an Ocean-based integration's mapping to the one used in its last successful resync, then triggers a new resync with that mapping.
This is useful for reverting an unwanted or broken mapping change, without having to manually reconstruct the previous configuration.
To learn more about configuring mappings, check out the documentation.
Permission requirements
To use this endpoint, you must have a moderator or admin role in your Port organization.
To learn more about the different roles and permissions, please refer to the documentation.
Request
Parameters (JSON)
{
"parameters": [
{
"schema": {
"type": "string"
},
"in": "path",
"name": "integration_id",
"required": true,
"description": "The unique identifier of the integration you want to resync."
}
]
}Request body schema (JSON)
{
"title": "Body",
"body": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"trigger": {
"type": "string",
"enum": [
"manual",
"apply_mapping"
],
"description": "Determines how the restored mapping is applied. `manual` patches the restored config directly onto the integration. `apply_mapping` applies the restored config through the same path used when a mapping change is applied from the UI."
}
},
"required": [
"trigger"
]
}
}
},
"required": true
}
}Responses
- 200
- 400
- 401
- 403
- 404
- 500
Default Response
Default Response
Default Response
Default Response
Default Response
Default Response
Responses (JSON)
{
"responses": {
"200": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
},
"integration": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"installationId": {
"type": "string"
},
"installationType": {
"type": "string",
"enum": [
"OnPrem",
"Saas",
"SaasOAuth2",
"CustomGithubApp",
"EnterpriseGithubApp"
]
},
"integrationType": {
"type": "string"
},
"version": {
"type": "string"
},
"pinnedVersion": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"actionsProcessingEnabled": {
"type": "boolean"
},
"incrementalSyncEnabled": {
"type": "boolean"
},
"config": {
"anyOf": [
{},
{
"type": "null"
}
]
},
"deprecated": {
"type": "boolean"
},
"createPortResourcesOrigin": {
"type": "string",
"enum": [
"Empty",
"Port",
"Ocean",
"Default"
]
},
"spec": {
"type": "object",
"properties": {
"integrationSpec": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"appSpec": {
"type": "object",
"properties": {
"scheduledResyncInterval": {
"type": "string",
"enum": [
"1h",
"2h",
"3h",
"4h",
"6h",
"12h",
"24h",
"7d"
]
},
"sendRawDataExamples": {
"type": "boolean"
},
"liveEventsEnabled": {
"type": "boolean"
},
"lakehouseEnabled": {
"type": "boolean"
},
"actionsProcessingEnabled": {
"type": "boolean"
},
"incrementalSyncEnabled": {
"type": "boolean"
},
"incrementalSyncInterval": {
"type": "string",
"enum": [
"15m",
"30m",
"1h"
]
},
"liveEventsUuid": {
"type": "string"
},
"liveEventsIngestHostname": {
"type": "string"
}
},
"additionalProperties": false
},
"systemSpec": {
"type": "object",
"properties": {
"size": {
"type": "string",
"enum": [
"S",
"M",
"L",
"XL",
"XXL"
]
},
"lastSizeOverride": {
"type": "object",
"properties": {
"size": {
"type": "string",
"enum": [
"S",
"M",
"L",
"XL",
"XXL"
]
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"size",
"updatedAt"
],
"additionalProperties": false
},
"isDisabled": {
"type": "boolean"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"_orgId": {
"type": "string"
},
"installationAppType": {
"type": "string"
},
"clientId": {
"type": "string"
},
"changelogDestination": {
"anyOf": [
{
"type": "object",
"properties": {},
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"KAFKA"
]
}
},
"required": [
"type"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"WEBHOOK"
]
},
"url": {
"type": "string"
},
"agent": {
"type": "boolean"
}
},
"required": [
"type",
"url"
],
"additionalProperties": false
}
]
},
"resyncState": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"running",
"failed",
"completed",
"pending",
"syncing",
"aborted"
]
},
"lastResyncStart": {
"type": "string",
"format": "date-time"
},
"lastResyncEnd": {
"type": "string",
"format": "date-time"
},
"lastTrigger": {
"type": "string",
"enum": [
"scheduled",
"manual",
"apply_mapping"
]
},
"intervalInMinutes": {
"type": "number"
},
"nextResync": {
"type": "string",
"format": "date-time"
},
"failureMessage": {
"type": "string"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
},
"additionalProperties": false
},
"logAttributes": {
"type": "object",
"properties": {
"ingestId": {
"type": "string"
}
},
"additionalProperties": false
},
"statusInfo": {
"type": "object",
"properties": {
"integrationStatus": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"Creating",
"Error",
"Running",
"UnHealthy",
"Updating",
"Deleting",
"Deleted"
]
},
"lastSyncedAt": {
"type": "string",
"format": "date-time"
},
"message": {
"type": "string"
}
},
"required": [
"status"
],
"additionalProperties": false
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"integrationStatus"
],
"additionalProperties": false
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"arePortResourcesInitialized": {
"type": "boolean"
},
"processingMode": {
"type": "string",
"enum": [
"ocean-core",
"dsp"
]
},
"oauthBrokerUrl": {
"type": "string"
},
"githubExternalPropertiesNamespaceClaims": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "boolean",
"enum": [
true
]
}
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"_id",
"installationId",
"installationType",
"integrationType",
"version",
"_orgId",
"installationAppType",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"triggeredAction": {
"type": "string",
"enum": [
"manual",
"apply_mapping"
],
"description": "Determines how the restored mapping is applied. `manual` patches the restored config directly onto the integration. `apply_mapping` applies the restored config through the same path used when a mapping change is applied from the UI."
}
},
"required": [
"ok",
"integration",
"triggeredAction"
],
"additionalProperties": false
}
}
}
},
"400": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false
}
}
}
},
"401": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false
}
}
}
},
"403": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false
}
}
}
},
"404": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false
}
}
}
},
"500": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false
}
}
}
}
}
}