Create Account - POST
Once a User
is created, it's time to create an Account
.
This entity represents the connection of a given User
with a specific platform, so one User
can potentially have multiple Accounts
, each one representing a different platform.
Note
This endpoint is only available for accounts in IMSS or ISSSTE. All other platforms will require the use of Palenca Link or its widget in order to create an account.
To create a user's Account
, you need to make a POST
request to the endpoint
POST https://api.palenca.com/v1/accounts
Here are some examples in different languages:
- JavaScript
- Python
- curl
const axios = require('axios')
const data = JSON.stringify({
"user_id": "054d0a9d-38ec-40cb-a31c-09b483242e4a",
"country": "mx",
"platform": "imss",
"identifier": "GOPJ930704HDFPRR05"
});
const config = {
method: 'POST',
url: 'https://api.palenca.com/v1/accounts',
headers: {
'x-api-key': 'private_api_key',
'Content-Type': 'application/json'
},
data: data
};
(async () => {
try {
const {data} = await axios(config)
console.info(JSON.stringify(response.data))
} catch (error) {
console.error(error)
}
})()
import requests
url = 'https://api.palenca.com/v1/accounts'
payload = {
"user_id": "054d0a9d-38ec-40cb-a31c-09b483242e4a",
"country": "mx",
"platform": "imss",
"identifier": "GOPJ930704HDFPRR05"
}
headers = {
'x-api-key': 'private_api_key',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
curl --location --request POST 'https://api.palenca.com/v1/accounts' \
--header 'x-api-key: private_api_key' \
--header 'Content-Type: application/json'
--data-raw '{
"user_id": "054d0a9d-38ec-40cb-a31c-09b483242e4a",
"country": "mx",
"platform": "imss",
"identifier": "GOPJ930704HDFPRR05"
}'
Returns a JSON structured like this:
{
"success": true,
"error": null,
"data": {
"user_id": "054d0a9d-38ec-40cb-a31c-09b483242e4a",
"country": "mx",
"platform": "imss",
"account_id": "472f02e8-6b24-43a7-b529-3f71d6ecc81c"
}
}
Payload
Parameter | Description | Type | Required | Example |
---|---|---|---|---|
user_id | The ID of the user | uuid | True | 054d0a9d-38ec-40cb-a31c-09b483242e4a |
country | The user's account country | string | True | mx |
platform | The user's account platform | string | True | imss |
identifier | The credential used to access the platform, CURP for IMSS or ISSSTE | string | True | GOPJ930704HDFPRR05 |