V3 REFERENCE Contact Properties

/contactmetadata

Definition of available extra data items for contacts.

List contactmetadata resources available for this apikey, use a GET request. Alternatively, you may want to add one or more filters.

# list contactmetadata resources

curl -s -X GET \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contactmetadata
Unique Key

In addition to the resource $ID, you can also use the unique key $Namespace|$Name to identify this resource. Please refer to the field(s) description below for more information.

Properties
Name Description
Datatype Type of data.
  • Mandatory
  • [ Type TContactDataType ]

Allowed values:
  • str
  • int
  • float
  • bool
  • datetime
ID ID of this definition.
  • Read Only
  • [ Type Int64 ]
Name The name of the data. The name must be unique within a namespace.
  • Mandatory
  • [ Type AnsiString ]
NameSpace The namespace for this data. There are 2 possible values: static and historic.
  • Mandatory
  • Read Only
  • [ Type AnsiString ]
Filters
Name Description
DataType Only retrieve contactmetadata resources for which DataType equals the specified value.
  • [ Type AnsiString ]
Namespace Only retrieve contactmetadata resources for which Namespace equals the specified value.
  • [ Type AnsiString ]

Access a given contactmetadata resource, use a GET request, providing the contactmetadata's ID value.

# access the contactmetadata resource identified by $ID

curl -s -X GET \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contactmetadata/$ID

    
# access the resource through the Namespace|Name's value
# note: all keys marked as 'unique' may be used as an alternate ID

curl -s -X GET \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contactmetadata/$Namespace|$Name
    
    
Unique Key

In addition to the resource $ID, you can also use the unique key $Namespace|$Name to identify this resource. Please refer to the field(s) description below for more information.

Properties
Name Description
Datatype Type of data.
  • Mandatory
  • [ Type TContactDataType ]

Allowed values:
  • str
  • int
  • float
  • bool
  • datetime
ID ID of this definition.
  • Read Only
  • [ Type Int64 ]
Name The name of the data. The name must be unique within a namespace.
  • Mandatory
  • [ Type AnsiString ]
NameSpace The namespace for this data. There are 2 possible values: static and historic.
  • Mandatory
  • Read Only
  • [ Type AnsiString ]

Add a new contactmetadata resource with a POST request.

# add a new contactmetadata resource, beware of the Read Only fields!

curl -s -X POST \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contactmetadata \
-H 'Content-Type: application/json' \
-d '{"Datatype": ...}'
Unique Key

In addition to the resource $ID, you can also use the unique key $Namespace|$Name to identify this resource. Please refer to the field(s) description below for more information.

Properties
Name Description
Datatype Type of data.
  • Mandatory
  • [ Type TContactDataType ]

Allowed values:
  • str
  • int
  • float
  • bool
  • datetime
ID ID of this definition.
  • Read Only
  • [ Type Int64 ]
Name The name of the data. The name must be unique within a namespace.
  • Mandatory
  • [ Type AnsiString ]
NameSpace The namespace for this data. There are 2 possible values: static and historic.
  • Mandatory
  • Read Only
  • [ Type AnsiString ]

Update one specific contactmetadata resource with a PUT request, providing the contactmetadata's ID value. Be sure to include all the mandatory properties.

# update content of resource contactmetadata identified by ID $ID

curl -s -X PUT \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contactmetadata/$ID \
-H 'Content-Type: application/json' \
-d '{"Datatype": ...}'

    
# update the content, using the value of the Namespace|Name property
# note: all keys marked as 'unique' may be used as an alternate ID

curl -s -X PUT \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contactmetadata/:Namespace|Name \
-H 'Content-Type: application/json' \
-d '{"Datatype": ...}'
    
Unique Key

In addition to the resource $ID, you can also use the unique key $Namespace|$Name to identify this resource. Please refer to the field(s) description below for more information.

Properties
Name Description
Datatype Type of data.
  • Mandatory
  • [ Type TContactDataType ]

Allowed values:
  • str
  • int
  • float
  • bool
  • datetime
ID ID of this definition.
  • Read Only
  • [ Type Int64 ]
Name The name of the data. The name must be unique within a namespace.
  • Mandatory
  • [ Type AnsiString ]
NameSpace The namespace for this data. There are 2 possible values: static and historic.
  • Mandatory
  • Read Only
  • [ Type AnsiString ]

Remove one given contactmetadata resource with a DELETE request, providing the contactmetadata's ID value.

# delete resource contactmetadata with ID $ID

curl -s -X DELETE \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contactmetadata/$ID
    
# delete the resource using the alternate unique key Namespace|Name
# note: all keys marked as 'unique' may be used as an alternate ID

curl -s -X DELETE \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contactmetadata/:Namespace|Name
    
Unique Key

In addition to the resource $ID, you can also use the unique key $Namespace|$Name to identify this resource. Please refer to the field(s) description below for more information.