{"files":{"SKILL.md":"---\nname: twilio-sendgrid-marketing-campaigns-contacts-api\ndescription: \"Twilio SendGrid Marketing Campaigns Contacts API skill. Use when working with Twilio SendGrid Marketing Campaigns Contacts for marketing. Covers 15 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# Twilio SendGrid Marketing Campaigns Contacts API\nAPI version: 1.0.0\n\n## Auth\nBearer bearer\n\n## Base URL\nhttps://api.sendgrid.com\n\n## Setup\n1. Set Authorization header with Bearer token\n2. GET /v3/marketing/contacts -- get sample contacts\n3. POST /v3/marketing/contacts/batch -- create first batch\n\n## Endpoints\n15 endpoints across 1 group. See references/api-spec.lap for full details.\n\n### Marketing\n| Method | Path | Description |\n|--------|------|-------------|\n| PUT | /v3/marketing/contacts | Add or Update a Contact |\n| DELETE | /v3/marketing/contacts | Delete Contacts |\n| GET | /v3/marketing/contacts | Get Sample Contacts |\n| GET | /v3/marketing/contacts/{id} | Get a Contact by ID |\n| POST | /v3/marketing/contacts/batch | Get Batched Contacts by IDs |\n| DELETE | /v3/marketing/contacts/{contact_id}/identifiers | Delete a Contact Identifier |\n| GET | /v3/marketing/contacts/count | Get Total Contact Count |\n| POST | /v3/marketing/contacts/exports | Export Contacts |\n| GET | /v3/marketing/contacts/exports | Get All Existing Exports |\n| GET | /v3/marketing/contacts/exports/{id} | Export Contacts Status |\n| PUT | /v3/marketing/contacts/imports | Import Contacts |\n| GET | /v3/marketing/contacts/imports/{id} | Import Contacts Status |\n| POST | /v3/marketing/contacts/search | Search Contacts |\n| POST | /v3/marketing/contacts/search/emails | Get Contacts by Emails |\n| POST | /v3/marketing/contacts/search/identifiers/{identifier_type} | Get Contacts by Identifiers |\n\n## Common Questions\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"List all contacts?\" -> GET /v3/marketing/contacts\n- \"Get contact details?\" -> GET /v3/marketing/contacts/{id}\n- \"Create a batch?\" -> POST /v3/marketing/contacts/batch\n- \"List all count?\" -> GET /v3/marketing/contacts/count\n- \"Create a export?\" -> POST /v3/marketing/contacts/exports\n- \"List all exports?\" -> GET /v3/marketing/contacts/exports\n- \"Get export details?\" -> GET /v3/marketing/contacts/exports/{id}\n- \"Get import details?\" -> GET /v3/marketing/contacts/imports/{id}\n- \"Create a search?\" -> POST /v3/marketing/contacts/search\n- \"Create a email?\" -> POST /v3/marketing/contacts/search/emails\n- \"How to authenticate?\" -> See Auth section above\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Create/update endpoints return the modified resource on success\n- Error responses include status codes and descriptions in the spec\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Twilio SendGrid Marketing Campaigns Contacts API\n@base https://api.sendgrid.com\n@version 1.0.0\n@auth Bearer bearer\n@endpoints 15\n@toc marketing(15)\n\n@endpoint PUT /v3/marketing/contacts\n@desc Add or Update a Contact\n@required {contacts: [map{address_line_1: str, address_line_2: str, alternate_emails: [str], city: str, country: str, email: str, phone_number_id: str, external_id: str, anonymous_id: str, first_name: str, last_name: str, postal_code: str, state_province_region: str, custom_fields: map}] # One or more contacts objects that you intend to upsert. Each contact needs to include at least one of `email`, `phone_number_id`, `external_id`, or `anonymous_id` as an identifier.}\n@optional {list_ids: [str(uuid)] # An array of List ID strings that this contact will be added to.}\n@returns(202) {job_id: str}\n@errors {400, 401, 403, 404, 500}\n\n@endpoint DELETE /v3/marketing/contacts\n@desc Delete Contacts\n@optional {delete_all_contacts: str # Must be set to `\"true\"` to delete all contacts., ids: str # A comma-separated list of contact IDs.}\n@returns(202) {job_id: map}\n@errors {400, 401, 403, 404, 500}\n\n@endpoint GET /v3/marketing/contacts\n@desc Get Sample Contacts\n@returns(200) {result: [map], _metadata: map{self: str}, contact_count: int}\n@errors {400, 401, 403, 404, 500}\n\n@endpoint GET /v3/marketing/contacts/{id}\n@desc Get a Contact by ID\n@returns(200) {id: str, first_name: str, last_name: str, unique_name: str, email: str, phone_number_id: str, external_id: str, anonymous_id: str, alternate_emails: [str], address_line_1: str, address_line_2: str, city: str, state_province_region: str, country: str, postal_code: str, phone_number: str, whatsapp: str, line: str, facebook: str, list_ids: [str], segment_ids: [str], custom_fields: map, created_at: str, updated_at: str, _metadata: map{self: str}}\n@errors {401, 403, 404, 500}\n\n@endpoint POST /v3/marketing/contacts/batch\n@desc Get Batched Contacts by IDs\n@required {ids: [str]}\n@returns(200) {result: [map]}\n@errors {401, 403, 404, 500}\n\n@endpoint DELETE /v3/marketing/contacts/{contact_id}/identifiers\n@desc Delete a Contact Identifier\n@required {contact_id: str # Must be set to the `contact_id` of the contact you want to remove the identifier from., identifier_type: str(EMAIL/PHONENUMBERID/EXTERNALID/ANONYMOUSID), identifier_value: str # The value of the identifier you want to remove from the contact.}\n@returns(202) {job_id: map}\n@errors {400, 401, 403, 404, 500}\n\n@endpoint GET /v3/marketing/contacts/count\n@desc Get Total Contact Count\n@returns(200) {contact_count: int, billable_count: int, billable_breakdown: map{total: int, breakdown: map}}\n@errors {401, 403, 404, 500}\n\n@endpoint POST /v3/marketing/contacts/exports\n@desc Export Contacts\n@optional {list_ids: [str(uuid)] # IDs of the contact lists you want to export., segment_ids: [str] # IDs of the contact segments you want to export., notifications: map{email: bool}, file_type: str(csv/json), max_file_size: int=5000 # The maximum size of an export file in MB. Note that when this option is specified, multiple output files may be returned from the export.}\n@returns(202) {_metadata: map{prev: str(uri), self: str(uri), next: str(uri), count: num}, id: str}\n@errors {400, 401, 403, 404, 500}\n\n@endpoint GET /v3/marketing/contacts/exports\n@desc Get All Existing Exports\n@returns(200) {result: [map], _metadata: map{prev: str, self: str, next: str}}\n@errors {400, 401, 403, 404, 500}\n\n@endpoint GET /v3/marketing/contacts/exports/{id}\n@desc Export Contacts Status\n@returns(200) {id: str, status: str, created_at: str, updated_at: str, completed_at: str, expires_at: str, urls: [str], message: str, _metadata: map{prev: str(uri), self: str(uri), next: str(uri), count: num}, contact_count: int}\n@errors {400, 401, 403, 404, 500}\n\n@endpoint PUT /v3/marketing/contacts/imports\n@desc Import Contacts\n@required {file_type: str, field_mappings: [str] # Import file header to reserved/custom field mapping.}\n@optional {list_ids: [str] # All contacts will be added to each of the specified lists.}\n@returns(200) {job_id: str, upload_uri: str, upload_headers: [map]}\n@errors {400, 401, 403, 404, 500}\n\n@endpoint GET /v3/marketing/contacts/imports/{id}\n@desc Import Contacts Status\n@returns(200) {id: str, status: str, job_type: str, results: map{requested_count: num, created_count: num, updated_count: num, deleted_count: num, errored_count: num, errors_url: str}, started_at: str, finished_at: str}\n@errors {400, 401, 403, 404, 500}\n\n@endpoint POST /v3/marketing/contacts/search\n@desc Search Contacts\n@required {query: str # An SGQL search string or other pattern.}\n@returns(200) {result: [map], _metadata: map{self: str}, contact_count: num}\n@errors {400, 401, 403, 404, 408, 500}\n\n@endpoint POST /v3/marketing/contacts/search/emails\n@desc Get Contacts by Emails\n@required {emails: [str] # One or more primary and/or alternate email addresses to search for in your Marketing Campaigns contacts.}\n@optional {phone_number_id: str # The contact's Phone Number ID. This is required to be a valid phone number., external_id: str # The contact's External ID., anonymous_id: str # The contact's Anonymous ID.}\n@returns(200) {result: map}\n@errors {400, 401, 403, 404, 500}\n\n@endpoint POST /v3/marketing/contacts/search/identifiers/{identifier_type}\n@desc Get Contacts by Identifiers\n@required {identifiers: [str] # One or more more identifier values of the given identifier type to search for in your Marketing Campaigns contacts.}\n@returns(200) {result: map}\n@errors {400, 401, 403, 404, 500}\n\n@end\n"}}