twilio/location
The twilio/location content type allows you to send a location pin and an optional label, which you can use to enhance delivery notifications or provide location information to recipients.
(information)
Info
You can send location templates during an active 24-hour session with the recipient. You can't use them to initiate a business-initiated session.
Location templates aren't supported for approval on WhatsApp and can't be submitted for approval.

| Parameter | Type | Required | Variable support | Description |
|---|---|---|---|---|
longitude | Number | Yes | No | The longitude value of the location pin to send. Value must be between -180.0 and +180.0. |
latitude | Number | Yes | No | The latitude value of the location pin to send. Value must be between -90.0 and +90.0. |
label | String | No | Yes | Label to be displayed to the recipient alongside the location pin. |
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createContent() {14const content = await client.content.v1.contents.create({15friendly_name: "owl_air_location",16language: "en",17types: {18"twilio/text": {19body: "Owl Air: Time to board, SFO is located at San Francisco International Airport, P.O. Box 8097, San Francisco, CA 94128 ",20},21"twilio/location": {22latitude: 37.62159755922449,23longitude: -122.37888566473057,24label: "Time to Board @ SFO",25},26},27});2829console.log(content.dateCreated);30}3132createContent();
Response
1{2"sid": "HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "owl_air_location",5"language": "en",6"variables": {7"name": "foo"8},9"types": {10"twilio/text": {11"body": "Owl Air: Time to board, SFO is located at San Francisco International Airport, P.O. Box 8097, San Francisco, CA 94128 "12},13"twilio/location": {14"latitude": 37.62159755922449,15"longitude": -122.37888566473057,16"label": "Time to Board @ SFO"17}18},19"url": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",20"date_created": "2015-07-30T19:00:00Z",21"date_updated": "2015-07-30T19:00:00Z",22"links": {23"approval_create": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ApprovalRequests/whatsapp",24"approval_fetch": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ApprovalRequests"25}26}