Skip to content
Get started

Update contact card

client.ContactCard.Update(ctx, params) (*SetContactCard, error)
PATCH/v3/contact_card

Partially updates the contact card for a phone number.

Fetches the current contact card and merges the provided fields. Only fields present in the request body are updated; omitted fields retain their existing values.

If the update does not complete, the response is 500 (2022) — call this endpoint again.

ParametersExpand Collapse
params ContactCardUpdateParams
PhoneNumber param.Field[string]

Query param: E.164 phone number of the contact card to update

FirstName param.Field[string]Optional

Body param: Updated first name. If omitted, the existing value is kept.

ImageURL param.Field[string]Optional

Body param: Updated profile image URL. If omitted, the existing image is kept.

LastName param.Field[string]Optional

Body param: Updated last name. If omitted, the existing value is kept.

ReturnsExpand Collapse
type SetContactCard struct{…}
FirstName string

First name on the contact card

IsActive bool

Whether the contact card was successfully applied to the device

PhoneNumber string

The phone number the contact card is associated with

ImageURL stringOptional

Image URL on the contact card

LastName stringOptional

Last name on the contact card

Update contact card

package main

import (
  "context"
  "fmt"

  "github.com/linq-team/linq-go"
  "github.com/linq-team/linq-go/option"
)

func main() {
  client := linqgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  setContactCard, err := client.ContactCard.Update(context.TODO(), linqgo.ContactCardUpdateParams{
    PhoneNumber: "+15551234567",
    FirstName: linqgo.String("John"),
    ImageURL: linqgo.String("https://cdn.linqapp.com/contact-card/example.jpg"),
    LastName: linqgo.String("Doe"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", setContactCard.FirstName)
}
{
  "phone_number": "+15551234567",
  "first_name": "John",
  "last_name": "Doe",
  "image_url": "https://cdn.linqapp.com/contact-card/example.jpg",
  "is_active": true
}
{
  "error": {
    "status": 400,
    "code": 1002,
    "message": "Phone number must be in E.164 format",
    "doc_url": "https://docs.linqapp.com/error/codes/1xxx/1002/"
  },
  "success": false
}
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2004/"
  },
  "success": false
}
{
  "error": {
    "status": 403,
    "code": 2005,
    "message": "Access denied - insufficient permissions for this resource",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2005/"
  },
  "success": false
}
{
  "error": {
    "status": 404,
    "code": 2001,
    "message": "Resource not found",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2001/"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error",
    "doc_url": "https://docs.linqapp.com/error/codes/3xxx/3006/"
  },
  "success": false
}
Returns Examples
{
  "phone_number": "+15551234567",
  "first_name": "John",
  "last_name": "Doe",
  "image_url": "https://cdn.linqapp.com/contact-card/example.jpg",
  "is_active": true
}
{
  "error": {
    "status": 400,
    "code": 1002,
    "message": "Phone number must be in E.164 format",
    "doc_url": "https://docs.linqapp.com/error/codes/1xxx/1002/"
  },
  "success": false
}
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2004/"
  },
  "success": false
}
{
  "error": {
    "status": 403,
    "code": 2005,
    "message": "Access denied - insufficient permissions for this resource",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2005/"
  },
  "success": false
}
{
  "error": {
    "status": 404,
    "code": 2001,
    "message": "Resource not found",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2001/"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error",
    "doc_url": "https://docs.linqapp.com/error/codes/3xxx/3006/"
  },
  "success": false
}