Skip to content
V2 (Legacy) API ReferenceGet started

Update contact card

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

Partially updates an existing active contact card for a phone number.

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

Requires an active contact card to exist for the phone number.

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"
  },
  "success": false
}
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token"
  },
  "success": false
}
{
  "error": {
    "status": 403,
    "code": 2005,
    "message": "Access denied - insufficient permissions for this resource"
  },
  "success": false
}
{
  "error": {
    "status": 404,
    "code": 2001,
    "message": "Resource not found"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error"
  },
  "success": false
}
{
  "error": {
    "status": 503,
    "code": 4004,
    "message": "RCS capability check is temporarily unavailable."
  },
  "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"
  },
  "success": false
}
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token"
  },
  "success": false
}
{
  "error": {
    "status": 403,
    "code": 2005,
    "message": "Access denied - insufficient permissions for this resource"
  },
  "success": false
}
{
  "error": {
    "status": 404,
    "code": 2001,
    "message": "Resource not found"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error"
  },
  "success": false
}
{
  "error": {
    "status": 503,
    "code": 4004,
    "message": "RCS capability check is temporarily unavailable."
  },
  "success": false
}