{"note":"OpenAPI conversion -- returning structured metadata","name":"sendgrid-mc-contacts","description":"Twilio SendGrid Marketing Campaigns Contacts API","version":"1.0.0","base_url":"https://api.sendgrid.com","endpoints":15,"raw":"@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"}