> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.withpersona.com/2020-05-18/api-reference/accounts/run-account-action/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.withpersona.com/_mcp/server. # Run an account action POST https://api.withpersona.com/api/v1/accounts/{account-id}/run-action Content-Type: application/json Triggers an account action for the specified account Reference: https://docs.withpersona.com/api-reference/accounts/run-account-action ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `account-id` (string, required) — The ID of the account to run the action on ### Body (application/json) This endpoint expects an object. - `data` (AccountsAccountIdRunActionPostRequestBodyContentApplicationJsonSchemaData, required) ## Response ### 200 Account action executed successfully - `data` (account, required) — An Account object. Note that `fields` is **not** key inflected. - `meta` (AccountsAccountIdRunActionPostResponsesContentApplicationJsonSchemaMeta, required) ## Errors ### 400 Bad Request Error The request was unacceptable, often due to invalid parameters. - `errors` (list of AccountsAccountIdRunActionPostResponsesContentApplicationJsonSchemaErrorsItems, optional) ### 401 Unauthorized Error An invalid API key was provided. - `errors` (list of AccountsAccountIdRunActionPostResponsesContentApplicationJsonSchemaErrorsItems, optional) ### 403 Forbidden Error The given API key doesn’t have permissions to perform the request or a quota has been exceeded. - `errors` (list of AccountsAccountIdRunActionPostResponsesContentApplicationJsonSchemaErrorsItems, optional) ### 404 Not Found Error The requested resource doesn’t exist. - `errors` (list of AccountsAccountIdRunActionPostResponsesContentApplicationJsonSchemaErrorsItems, optional) ### 409 Conflict Error The request conflicts with another request, often due to attempting to create a duplicate resource. - `errors` (list of AccountsAccountIdRunActionPostResponsesContentApplicationJsonSchemaErrorsItems, optional) ### 422 Unprocessable Entity Error The request modifies the resource in an unacceptable way, often due to an invalid action or parameter. - `errors` (list of AccountsAccountIdRunActionPostResponsesContentApplicationJsonSchemaErrorsItems, optional) ### 429 Too Many Requests Error Your organization’s rate limit has been exceeded. We recommend an exponential backoff on requests. - `errors` (list of AccountsAccountIdRunActionPostResponsesContentApplicationJsonSchemaErrorsItems, optional) ## Types ### AccountsAccountIdRunActionPostRequestBodyContentApplicationJsonSchemaData - `account-action-id` (string, required) — The ID of the account action to run - `parameters` (map from string to any, optional) — Parameters required by the account action ### account An Account object. Note that `fields` is **not** key inflected. - `id` (string, optional) - `attributes` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributes, optional) - `relationships` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountRelationships, optional) ### AccountsAccountIdRunActionPostResponsesContentApplicationJsonSchemaMeta - `workflow-run-id` (string, required) — The ID of the workflow run created by this action ### AccountsAccountIdRunActionPostResponsesContentApplicationJsonSchemaErrorsItems - `title` (string, optional) - `details` (string, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributes - `reference-id` (string, optional, nullable) - `account-type-name` (string, optional) - `created-at` (datetime, optional) - `updated-at` (datetime, optional) - `redacted-at` (datetime, optional, nullable) - `fields` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFields, optional) — JSON key-value pairs of field name to field value. Exact schema depends on the configuration of the Account Type for this Account. Keys in `fields` are **not** key inflected. - `tags` (list of string, optional) - `account-status` (string, optional) - `birthdate` (date, optional, nullable) — Birthdate, must be in the format "YYYY-MM-DD". - `name-first` (string, optional, nullable) — Given or first name. - `name-middle` (string, optional, nullable) — Middle name. - `name-last` (string, optional, nullable) — Family or last name. - `phone-number` (string, optional, nullable) — Phone number. - `email-address` (string, optional, nullable) — Email address. - `address-street-1` (string, optional, nullable) — Street name of residence address. - `address-street-2` (string, optional, nullable) — Extension of residence address, usually apartment or suite number. - `address-city` (string, optional, nullable) — City of residence address. Not all international addresses use this attribute. - `address-subdivision` (string, optional, nullable) — State or subdivision of residence address. In the US, this should be the unabbreviated name. Not all international addresses use this attribute. - `address-postal-code` (string, optional, nullable) — ZIP or postal code of residence address. Not all international addresses use this attribute. - `country-code` (string, optional, nullable) — ISO 3166-1 alpha 2 country code. - `identification-numbers` (map from string to list of VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesIdentificationNumbersItems, optional) — Keys will be the identification class - `social-security-number` (string, optional, nullable) — Social security number. ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountRelationships - `account-type` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountRelationshipsAccountType, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFields JSON key-value pairs of field name to field value. Exact schema depends on the configuration of the Account Type for this Account. Keys in `fields` are **not** key inflected. - `name` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsName, optional) - `address` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddress, optional) - `identification_numbers` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbers, optional) - `birthdate` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsBirthdate, optional) - `phone_number` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsPhoneNumber, optional) - `email_address` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsEmailAddress, optional) - `selfie_photo` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsSelfiePhoto, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesIdentificationNumbersItems - `issuing-country` (string, optional) - `identification-class` (string, optional) - `identification-number` (string, optional) - `created-at` (datetime, optional) - `updated-at` (datetime, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountRelationshipsAccountType - `data` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountRelationshipsAccountTypeData, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsName - `type` (string, optional) - `value` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsNameValue, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddress - `type` (string, optional) - `value` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValue, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbers - `type` (string, optional) - `value` (list of VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbersValueItems, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsBirthdate - `type` (string, optional) - `value` (string, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsPhoneNumber - `type` (string, optional) - `value` (string, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsEmailAddress - `type` (string, optional) - `value` (string, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsSelfiePhoto - `type` ("file", optional) - `value` (File, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountRelationshipsAccountTypeData - `id` (string, optional) - `type` ("account-type", optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsNameValue - `first` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsNameValueFirst, optional) - `middle` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsNameValueMiddle, optional) - `last` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsNameValueLast, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValue - `street_1` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValueStreet1, optional) - `street_2` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValueStreet2, optional) - `subdivision` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValueSubdivision, optional) - `city` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValueCity, optional) - `postal_code` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValuePostalCode, optional) - `country_code` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValueCountryCode, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbersValueItems - `type` (string, optional) - `value` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbersValueItemsValue, optional) ### File - `filename` (string, optional) - `url` (string, optional) - `byte-size` (integer, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsNameValueFirst - `type` (string, optional) - `value` (string, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsNameValueMiddle - `type` (string, optional) - `value` (string, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsNameValueLast - `type` (string, optional) - `value` (string, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValueStreet1 - `type` (string, optional) - `value` (string, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValueStreet2 - `type` (string, optional) - `value` (string, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValueSubdivision - `type` (string, optional) - `value` (string, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValueCity - `type` (string, optional) - `value` (string, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValuePostalCode - `type` (string, optional) - `value` (string, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsAddressValueCountryCode - `type` (string, optional) - `value` (string, optional, nullable) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbersValueItemsValue - `identification_class` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbersValueItemsValueIdentificationClass, optional) - `identification_number` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbersValueItemsValueIdentificationNumber, optional) - `issuing_country` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbersValueItemsValueIssuingCountry, optional) - `hashed_identification_number` (VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbersValueItemsValueHashedIdentificationNumber, optional) — A SHA-256 hash of the identification number, keyed on organization, country code, identification class, and issuing subdivision. Stable across re-verifications of the same document for the same organization. Null when the identification number has not been hashed. ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbersValueItemsValueIdentificationClass - `type` (string, optional) - `value` (string, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbersValueItemsValueIdentificationNumber - `type` (string, optional) - `value` (string, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbersValueItemsValueIssuingCountry - `type` (string, optional) - `value` (string, optional) ### VerificationIncludedObjectsItemsDiscriminatorMappingAccountAttributesFieldsIdentificationNumbersValueItemsValueHashedIdentificationNumber A SHA-256 hash of the identification number, keyed on organization, country code, identification class, and issuing subdivision. Stable across re-verifications of the same document for the same organization. Null when the identification number has not been hashed. - `type` (string, optional) - `value` (string, optional, nullable) ## Examples ### Success **Response** ```json { "data": { "id": "act_hpNqyAbEG4HeVjZoBRNCMKkA", "attributes": { "reference-id": "abc-123", "account-type-name": "User", "created-at": "2023-09-22T17:13:49.000Z", "updated-at": "2023-09-23T00:22:19.000Z", "redacted-at": null, "fields": { "name": { "type": "hash", "value": { "first": { "type": "string", "value": "Jane" }, "middle": { "type": "string", "value": "Marie" }, "last": { "type": "string", "value": "Doe" } } }, "address": { "type": "hash", "value": { "street_1": { "type": "string", "value": "123 Main St" }, "street_2": { "type": "string", "value": null }, "subdivision": { "type": "string", "value": "California" }, "city": { "type": "string", "value": "San Francisco" }, "postal_code": { "type": "string", "value": "94111" }, "country_code": { "type": "string", "value": "US" } } }, "identification_numbers": { "type": "array", "value": [ { "type": "hash", "value": { "identification_class": { "type": "string", "value": "visa" }, "identification_number": { "type": "string", "value": "12345678" }, "issuing_country": { "type": "string", "value": "US" } } }, { "type": "hash", "value": { "identification_class": { "type": "string", "value": "visa" }, "identification_number": { "type": "string", "value": "87654321" }, "issuing_country": { "type": "string", "value": "UK" } } }, { "type": "hash", "value": { "identification_class": { "type": "string", "value": "cct" }, "identification_number": { "type": "string", "value": "A12345678" }, "issuing_country": { "type": "string", "value": "AF" } } } ] }, "birthdate": { "type": "date", "value": "1994-12-30" }, "phone_number": { "type": "string", "value": "111-222-3333" }, "email_address": { "type": "string", "value": "jane@doe.com" }, "selfie_photo": { "type": "file" } }, "tags": [ "tag1", "tag2" ] }, "relationships": { "account-type": { "data": { "id": "acttp_7X5W5w9GMtQntE6oPtKnj44c", "type": "account-type" } } }, "type": "account" }, "meta": { "workflow-run-id": "wfr_abc123def456ghi789" } } ``` **SDK Code** ```python Success import requests url = "https://api.withpersona.com/api/v1/accounts/account-id/run-action" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript Success const url = 'https://api.withpersona.com/api/v1/accounts/account-id/run-action'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Success package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.withpersona.com/api/v1/accounts/account-id/run-action" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Success require 'uri' require 'net/http' url = URI("https://api.withpersona.com/api/v1/accounts/account-id/run-action") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java Success import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.withpersona.com/api/v1/accounts/account-id/run-action") .header("Authorization", "Bearer ") .asString(); ``` ```php Success request('POST', 'https://api.withpersona.com/api/v1/accounts/account-id/run-action', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp Success using RestSharp; var client = new RestClient("https://api.withpersona.com/api/v1/accounts/account-id/run-action"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift Success import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.withpersona.com/api/v1/accounts/account-id/run-action")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Basic account action trigger **Request** ```json { "data": { "account-action-id": "accac_h4Ln3agRBwdpZD55Lef8fDwjuvjG", "parameters": { "status": "activated" } } } ``` **Response** ```json { "data": { "id": "act_hpNqyAbEG4HeVjZoBRNCMKkA", "attributes": { "reference-id": "abc-123", "account-type-name": "User", "created-at": "2023-09-22T17:13:49.000Z", "updated-at": "2023-09-23T00:22:19.000Z", "redacted-at": null, "fields": { "name": { "type": "hash", "value": { "first": { "type": "string", "value": "Jane" }, "middle": { "type": "string", "value": "Marie" }, "last": { "type": "string", "value": "Doe" } } }, "address": { "type": "hash", "value": { "street_1": { "type": "string", "value": "123 Main St" }, "street_2": { "type": "string", "value": null }, "subdivision": { "type": "string", "value": "California" }, "city": { "type": "string", "value": "San Francisco" }, "postal_code": { "type": "string", "value": "94111" }, "country_code": { "type": "string", "value": "US" } } }, "identification_numbers": { "type": "array", "value": [ { "type": "hash", "value": { "identification_class": { "type": "string", "value": "visa" }, "identification_number": { "type": "string", "value": "12345678" }, "issuing_country": { "type": "string", "value": "US" } } }, { "type": "hash", "value": { "identification_class": { "type": "string", "value": "visa" }, "identification_number": { "type": "string", "value": "87654321" }, "issuing_country": { "type": "string", "value": "UK" } } }, { "type": "hash", "value": { "identification_class": { "type": "string", "value": "cct" }, "identification_number": { "type": "string", "value": "A12345678" }, "issuing_country": { "type": "string", "value": "AF" } } } ] }, "birthdate": { "type": "date", "value": "1994-12-30" }, "phone_number": { "type": "string", "value": "111-222-3333" }, "email_address": { "type": "string", "value": "jane@doe.com" }, "selfie_photo": { "type": "file" } }, "tags": [ "tag1", "tag2" ] }, "relationships": { "account-type": { "data": { "id": "acttp_7X5W5w9GMtQntE6oPtKnj44c", "type": "account-type" } } }, "type": "account" }, "meta": { "workflow-run-id": "wfr_abc123def456ghi789" } } ``` **SDK Code** ```python Basic account action trigger import requests url = "https://api.withpersona.com/api/v1/accounts/account-id/run-action" payload = { "data": { "account-action-id": "accac_h4Ln3agRBwdpZD55Lef8fDwjuvjG", "parameters": { "status": "activated" } } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Basic account action trigger const url = 'https://api.withpersona.com/api/v1/accounts/account-id/run-action'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"data":{"account-action-id":"accac_h4Ln3agRBwdpZD55Lef8fDwjuvjG","parameters":{"status":"activated"}}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Basic account action trigger package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.withpersona.com/api/v1/accounts/account-id/run-action" payload := strings.NewReader("{\n \"data\": {\n \"account-action-id\": \"accac_h4Ln3agRBwdpZD55Lef8fDwjuvjG\",\n \"parameters\": {\n \"status\": \"activated\"\n }\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Basic account action trigger require 'uri' require 'net/http' url = URI("https://api.withpersona.com/api/v1/accounts/account-id/run-action") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"data\": {\n \"account-action-id\": \"accac_h4Ln3agRBwdpZD55Lef8fDwjuvjG\",\n \"parameters\": {\n \"status\": \"activated\"\n }\n }\n}" response = http.request(request) puts response.read_body ``` ```java Basic account action trigger import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.withpersona.com/api/v1/accounts/account-id/run-action") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"data\": {\n \"account-action-id\": \"accac_h4Ln3agRBwdpZD55Lef8fDwjuvjG\",\n \"parameters\": {\n \"status\": \"activated\"\n }\n }\n}") .asString(); ``` ```php Basic account action trigger request('POST', 'https://api.withpersona.com/api/v1/accounts/account-id/run-action', [ 'body' => '{ "data": { "account-action-id": "accac_h4Ln3agRBwdpZD55Lef8fDwjuvjG", "parameters": { "status": "activated" } } }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Basic account action trigger using RestSharp; var client = new RestClient("https://api.withpersona.com/api/v1/accounts/account-id/run-action"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"data\": {\n \"account-action-id\": \"accac_h4Ln3agRBwdpZD55Lef8fDwjuvjG\",\n \"parameters\": {\n \"status\": \"activated\"\n }\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Basic account action trigger import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["data": [ "account-action-id": "accac_h4Ln3agRBwdpZD55Lef8fDwjuvjG", "parameters": ["status": "activated"] ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.withpersona.com/api/v1/accounts/account-id/run-action")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```