# REST Resource: projects.unsubscribers

## Resource: Unsubscriber

The Unsubscriber resource.

<div class="highlight"><span class="filename">JSON representation</span><pre><code><span class="p">{</span>
  <span class="s2">&quot;name&quot;</span><span class="p">: </span><span class="kd">string</span><span class="p">,</span>
  <span class="s2">&quot;phone&quot;</span><span class="p">: </span><span class="kd">string</span><span class="p">,</span>
  <span class="s2">&quot;unsubscribeMethod&quot;</span><span class="p">: </span><span class="kd">enum (</span><a href="#unsubscriberunsubscribemethod"><strong><span class="kd">UnsubscribeMethod</span></strong></a><span class="kd">)</span><span class="p">,</span>
  <span class="s2">&quot;labels&quot;</span><span class="p">: </span><span class="p">{</span>
    <span class="kd">string</span><span class="p">: </span><span class="kd">string</span><span class="p">,</span>
    <span class="p">...</span>
  <span class="p">}</span><span class="p">,</span>
  <span class="s2">&quot;createTime&quot;</span><span class="p">: </span><span class="kd">string (</span><a href="https://developers.google.com/protocol-buffers/docs/proto3#json" target="_blank"><strong><span class="kd">Timestamp</span></strong></a><span class="kd">)</span>
<span class="p">}</span></code></pre></div>

Fields | &nbsp;
--|--
<span class="e-code">name</span> | <span class="e-code">string</span><br/>Resource name of the unsubscriber. It must match the pattern `projects/*/unsubscribers/*`
<span class="e-code">phone</span> | <span class="e-code">string</span><br/>Required. The phone number of the recipient that has unsubscribed, in +E164 format. Can only be set on create.
<span class="e-code">unsubscribeMethod</span> | <span class="e-code">enum ([UnsubscribeMethod](#unsubscriberunsubscribemethod))</span><br/>The method that was used to unsubscribe. Can only be set on create.
<span class="e-code">labels</span> | <span class="e-code">map (key: <span class="e-code">string</span>, value: <span class="e-code">string</span>)</span><br/>The labels associated with the unsubscriber.  The maximum key length is 100.  The maximum value length is 1000. The maximum number of keys is 50.<br/><br/>Example keys: - `smsmarketing.enfonica.com/campaign`
<span class="e-code">createTime</span> | <span class="e-code">string (<a href="https://developers.google.com/protocol-buffers/docs/proto3#json" target="_blank">Timestamp</a> format)</span><br/>Output only. The creation time of the unsubscriber.

## Unsubscriber.UnsubscribeMethod

The method that was used to unsubscribe.

Enums | &nbsp;
--|--
<span class="e-code">UNSUBSCRIBE_METHOD_UNSPECIFIED</span> | Unknown unsubscribe method.
<span class="e-code">URL</span> | Unsubscribed by visiting a URL.
<span class="e-code">MESSAGE</span> | Unsubscribed by sending a message.
<span class="e-code">MANUAL</span> | A user has manually created the unsubscriber.

## Methods

Methods | &nbsp;
--|--
<span class="e-code">[create](/docs/cloud-sms/api-reference/rest/v1/projects.unsubscribers/create/)</span> | <span class="e-code">POST /v1/{parent}/unsubscribers</span><br/>Creates an unsubscriber.<br/><br/>The caller must have `messaging.unsubscribers.create` permission on the project.
<span class="e-code">[get](/docs/cloud-sms/api-reference/rest/v1/projects.unsubscribers/get/)</span> | <span class="e-code">GET /v1/{name}</span><br/>Retrieves a Unsubscriber identified by the supplied resource name.<br/><br/>The caller must have `messaging.unsubscribers.get` permission on the project.
<span class="e-code">[list](/docs/cloud-sms/api-reference/rest/v1/projects.unsubscribers/list/)</span> | <span class="e-code">GET /v1/{parent}/unsubscribers</span><br/>Lists the Unsubscribers of the specified project. List returns Unsubscribers sorted by create_time descending.<br/><br/>The caller must have `messaging.unsubscribers.list` permission on the project.
<span class="e-code">[update](/docs/cloud-sms/api-reference/rest/v1/projects.unsubscribers/update/)</span> | <span class="e-code">PATCH /v1/{unsubscriber.name}</span><br/>Updates an unsubscriber.<br/><br/>The caller must have `messaging.unsubscribers.update` permission on the project.
<span class="e-code">[delete](/docs/cloud-sms/api-reference/rest/v1/projects.unsubscribers/delete/)</span> | <span class="e-code">DELETE /v1/{name}</span><br/>Deletes an unsubscriber.<br/><br/>The caller must have `messaging.unsubscribers.delete` permission on the project.

