Create Opportunity
curl --request POST \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/opportunities \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '{}'const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/opportunities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/opportunities"
payload = {}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"title": "<string>",
"stage": 123,
"expected_value": 123,
"estimated_close_date": "2023-11-07T05:31:56Z",
"win_probability": 123,
"lose_reason": "<string>",
"company_id": 123,
"contact_id": 123,
"owner_id": 123,
"source_conversation_id": 123,
"source_message_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"company": {
"id": 123,
"name": "<string>",
"contacts_count": 123,
"domain": "<string>",
"description": "<string>",
"avatar_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"contacts": [
{
"id": 123,
"name": "<string>",
"email": "<string>",
"thumbnail": "<string>"
}
]
},
"contact": {
"payload": [
{
"additional_attributes": {},
"availability_status": "<string>",
"email": "<string>",
"id": 123,
"name": "<string>",
"phone_number": "<string>",
"blocked": true,
"identifier": "<string>",
"thumbnail": "<string>",
"custom_attributes": {
"attribute_key": "attribute_value",
"signed_up_at": "dd/mm/yyyy"
},
"last_activity_at": 123,
"created_at": 123,
"contact_inboxes": [
{
"source_id": "<string>",
"inbox": {
"id": 123,
"avatar_url": "<string>",
"channel_id": 123,
"name": "<string>",
"channel_type": "<string>",
"provider": "<string>"
}
}
]
}
]
},
"owner": {
"id": 123,
"access_token": "<string>",
"account_id": 123,
"available_name": "<string>",
"avatar_url": "<string>",
"confirmed": true,
"display_name": "<string>",
"message_signature": "<string>",
"email": "<string>",
"hmac_identifier": "<string>",
"inviter_id": 123,
"name": "<string>",
"provider": "<string>",
"pubsub_token": "<string>",
"role": "agent",
"ui_settings": {},
"uid": "<string>",
"type": "<string>",
"custom_attributes": {},
"accounts": [
{
"id": 123,
"name": "<string>",
"status": "<string>",
"active_at": "2023-11-07T05:31:56Z",
"role": "administrator",
"permissions": [
"<string>"
],
"availability": "<string>",
"availability_status": "<string>",
"auto_offline": true,
"custom_role_id": 123,
"custom_role": {}
}
]
}
}Opportunities
Create Opportunity
Create a new opportunity
POST
/
api
/
v1
/
accounts
/
{account_id}
/
opportunities
Create Opportunity
curl --request POST \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/opportunities \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '{}'const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/opportunities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/opportunities"
payload = {}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"title": "<string>",
"stage": 123,
"expected_value": 123,
"estimated_close_date": "2023-11-07T05:31:56Z",
"win_probability": 123,
"lose_reason": "<string>",
"company_id": 123,
"contact_id": 123,
"owner_id": 123,
"source_conversation_id": 123,
"source_message_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"company": {
"id": 123,
"name": "<string>",
"contacts_count": 123,
"domain": "<string>",
"description": "<string>",
"avatar_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"contacts": [
{
"id": 123,
"name": "<string>",
"email": "<string>",
"thumbnail": "<string>"
}
]
},
"contact": {
"payload": [
{
"additional_attributes": {},
"availability_status": "<string>",
"email": "<string>",
"id": 123,
"name": "<string>",
"phone_number": "<string>",
"blocked": true,
"identifier": "<string>",
"thumbnail": "<string>",
"custom_attributes": {
"attribute_key": "attribute_value",
"signed_up_at": "dd/mm/yyyy"
},
"last_activity_at": 123,
"created_at": 123,
"contact_inboxes": [
{
"source_id": "<string>",
"inbox": {
"id": 123,
"avatar_url": "<string>",
"channel_id": 123,
"name": "<string>",
"channel_type": "<string>",
"provider": "<string>"
}
}
]
}
]
},
"owner": {
"id": 123,
"access_token": "<string>",
"account_id": 123,
"available_name": "<string>",
"avatar_url": "<string>",
"confirmed": true,
"display_name": "<string>",
"message_signature": "<string>",
"email": "<string>",
"hmac_identifier": "<string>",
"inviter_id": 123,
"name": "<string>",
"provider": "<string>",
"pubsub_token": "<string>",
"role": "agent",
"ui_settings": {},
"uid": "<string>",
"type": "<string>",
"custom_attributes": {},
"accounts": [
{
"id": 123,
"name": "<string>",
"status": "<string>",
"active_at": "2023-11-07T05:31:56Z",
"role": "administrator",
"permissions": [
"<string>"
],
"availability": "<string>",
"availability_status": "<string>",
"auto_offline": true,
"custom_role_id": 123,
"custom_role": {}
}
]
}
}Authorizations
Path Parameters
The numeric ID of the account
Body
application/json
Show child attributes
Show child attributes
Response
200 - application/json
Success
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes