# Set consent preferences for a user (/docs/api-reference/preferences-client-side/post-consent-sync)

Set consent preferences for a user at https://consent.transcend.io or https://consent.us.transcend.io. N.B. This is ___not___ a Sombra route. Authenticate with a signed JWT that carries identifier name/value pairs (preferred) or the deprecated single encryptedIdentifier. See reference for details.

## POST /sync

```json
{
  "servers": [
    {
      "url": "https://multi-tenant.sombra.transcend.io",
      "description": "Multi-tenant (EU)"
    },
    {
      "url": "https://multi-tenant.sombra.us.transcend.io",
      "description": "Multi-tenant (US)"
    },
    {
      "description": "Self-hosted",
      "url": "https://_yourOrganizationSombraURL_.com"
    },
    {
      "description": "Preference Store in Europe",
      "url": "https://consent.transcend.io"
    },
    {
      "description": "Preference Store in the U.S.",
      "url": "https://consent.us.transcend.io"
    },
    {
      "description": "Rules Automation webhook ingestion (EU)",
      "url": "https://rule-automation.transcend.io"
    },
    {
      "description": "Rules Automation webhook ingestion (US)",
      "url": "https://rule-automation.us.transcend.io"
    }
  ],
  "security": [
    {
      "Transcend_API_Key": [],
      "Sombra_Token": [],
      "Transcend_API_Key_If_Multitenant": []
    }
  ],
  "operation": {
    "summary": "Set consent preferences for a user",
    "description": "Set consent preferences for a user at `https://consent.transcend.io` or `https://consent.us.transcend.io`.  ***N.B.*** This is ___not___ a Sombra route.  Authenticate with a signed JWT that carries **identifier name/value pairs** (preferred) or the deprecated single `encryptedIdentifier`. See [reference](https://docs.transcend.io/docs/preference-store/storing-consent-preferences) for details.",
    "responses": {
      "200": {
        "description": "Upserts consent preferences and returns merged results",
        "content": {
          "application/json": {
            "schema": {
              "required": [
                "purposes",
                "confirmed",
                "timestamp"
              ],
              "type": "object",
              "properties": {
                "purposes": {
                  "type": "object",
                  "description": "Consent purposes to update"
                },
                "confirmed": {
                  "type": "boolean",
                  "description": "Was tracking consent confirmed by the user? If this is false, the consent was resolved from defaults & is not yet confirmed"
                },
                "timestamp": {
                  "type": "string",
                  "description": "Timestamp of when consent was collected"
                },
                "updated": {
                  "description": "Has the consent been updated (including no-change confirmation) since default resolution",
                  "type": "boolean"
                },
                "prompted": {
                  "description": "Whether or not the UI has been shown to the end-user (undefined in older versions of airgap.js)",
                  "type": "boolean"
                },
                "usp": {
                  "description": "US Privacy (USP) String",
                  "type": "string"
                },
                "tcf": {
                  "description": "IAB Transparency & Consent Framework (TCF) 2.0 consent metadata",
                  "type": "string"
                }
              }
            },
            "examples": {
              "Consent for user": {
                "value": {
                  "purposes": {
                    "TestPurpose": false
                  },
                  "confirmed": true,
                  "timestamp": "2023-05-11T19:32:31.707Z"
                }
              }
            }
          }
        }
      },
      "400": {
        "description": "The token could not be verified or decoded",
        "headers": {},
        "content": {
          "application/json": {
            "schema": {
              "description": "",
              "type": "object",
              "properties": {}
            }
          }
        }
      },
      "500": {
        "description": "A 500 error means the backend is having issues. You check our system status at status.transcend.io. Please reach out to Transcend support if you're experiencing this error.",
        "headers": {},
        "content": {
          "application/json": {
            "schema": {
              "description": "",
              "type": "object",
              "properties": {}
            }
          }
        }
      }
    },
    "operationId": "post-consent-sync",
    "parameters": [
      {
        "$ref": "#/components/parameters/content-type-application-json"
      }
    ],
    "security": [],
    "requestBody": {
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "partition",
              "token",
              "consent"
            ],
            "properties": {
              "partition": {
                "type": "string",
                "description": "The consent partition or bundle ID. You can find the partition value under Consent Management > Developer Settings. If this value is not set, please use your bundle ID."
              },
              "token": {
                "type": "string",
                "description": "A JWT signed with HS384. Prefer `{ \"identifiers\": [{ \"name\": \"email\", \"value\": \"<AES-KWP encrypted value>\" }] }`. Encrypt each value with your Preference Store encryption key (AES-KWP, base64). At least one identifier must be unique for the partition. Lowercase emails (and otherwise normalize identifiers) on your backend before encryption — Transcend never sees decrypted values and does not validate them. Deprecated: `{ \"encryptedIdentifier\": \"<AES-KWP encrypted value>\" }`. See [Storing Consent Preferences](https://docs.transcend.io/docs/preference-store/storing-consent-preferences)."
              },
              "consent": {
                "required": [
                  "purposes",
                  "confirmed",
                  "timestamp"
                ],
                "type": "object",
                "properties": {
                  "purposes": {
                    "type": "object",
                    "description": "Consent purposes to update"
                  },
                  "confirmed": {
                    "type": "boolean",
                    "description": "Was tracking consent confirmed by the user? If this is false, the consent was resolved from defaults & is not yet confirmed"
                  },
                  "timestamp": {
                    "type": "string",
                    "description": "Timestamp of when consent was collected"
                  },
                  "updated": {
                    "description": "Has the consent been updated (including no-change confirmation) since default resolution",
                    "type": "boolean"
                  },
                  "prompted": {
                    "description": "Whether or not the UI has been shown to the end-user (undefined in older versions of airgap.js)",
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "examples": {
            "Set consent for a user (preferred identifiers JWT)": {
              "summary": "Preferred: identifiers name/value pairs in the JWT",
              "description": "JWT payload shape: `{ \"identifiers\": [{ \"name\": \"email\", \"value\": \"<encrypted>\" }] }`. Lowercase the email (or otherwise normalize) before AES-KWP encryption.",
              "value": {
                "token": "eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9.eyJpZGVudGlmaWVycyI6W3sibmFtZSI6ImVtYWlsIiwidmFsdWUiOiJGSDZOK2RlZ1ZjYjM2WDMxYXYvWnh3PT0ifV0sImlhdCI6MTY4MzY0NDk0Mn0.IRNqiXOz8oYJuWqdWfstgIjmQ9B_uJ-gvkw1mT5uUT-G9xdlPJ7zeODCCvlNIbf_",
                "partition": "7b9916f1-a9f7-45bd-b6d4-4bd7decfddaa",
                "consent": {
                  "purposes": {
                    "TestPurpose": false
                  },
                  "confirmed": true,
                  "timestamp": "2023-05-11T19:32:31.707Z"
                }
              }
            },
            "Set consent for a user (deprecated encryptedIdentifier JWT)": {
              "summary": "Deprecated: single encryptedIdentifier in the JWT",
              "description": "Legacy JWT payload shape: `{ \"encryptedIdentifier\": \"<encrypted>\" }`. Prefer `identifiers` instead.",
              "value": {
                "token": "eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9.eyJlbmNyeXB0ZWRJZGVudGlmaWVyIjoiRkg2TitkZWdWY2IzNlgzMWF2L1p4dz09IiwiaWF0IjoxNjgzNjQ0OTQyfQ.IRNqiXOz8oYJuWqdWfstgIjmQ9B_uJ-gvkw1mT5uUT-G9xdlPJ7zeODCCvlNIbf_",
                "partition": "7b9916f1-a9f7-45bd-b6d4-4bd7decfddaa",
                "consent": {
                  "purposes": {
                    "TestPurpose": false
                  },
                  "confirmed": true,
                  "timestamp": "2023-05-11T19:32:31.707Z"
                }
              }
            }
          }
        }
      }
    },
    "tags": [
      "Preferences (Client-Side)"
    ]
  }
}
```