> ## Documentation Index
> Fetch the complete documentation index at: https://docs.grdd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit User/Company

> Update user or company details through the GNet Connect API.

## Editing User/Company API

The **Editing User/Company API** allows you to modify existing company or user details, such as contact information, address, and branding assets. This endpoint ensures that your data remains up to date and accurate.

***

### **Endpoint**

`PUT /api/company/edit`

***

### **Request Body Schema**

The following schema defines the updatable fields for user or company details:

```ts theme={null}
const EditCompanySchema = z.object({
  griddid: z.string().readonly(),
  mainEmail: z.string().optional(),
  mainPhone: z.string().optional(),
  mainContact: z.string().optional(),
  webURL: z.string().optional(),
  address: z.string().optional(),
  city: z.string().optional(),
  state: z.string().optional(),
  zipCode: z.string().optional(),
  country: z.string().optional(),
  logo: z.number().optional(),
});
```

| Field       | Type   | Description                        | Required |
| ----------- | ------ | ---------------------------------- | -------- |
| griddid     | string | Unique GNET ID for the company     | Yes      |
| mainEmail   | string | Primary email for contact          | No       |
| mainPhone   | string | Primary phone number               | No       |
| mainContact | string | Name of the main contact person    | No       |
| webURL      | string | Company website URL                | No       |
| address     | string | Street address of the company      | No       |
| city        | string | City where the company is located  | No       |
| state       | string | State where the company is located | No       |
| zipCode     | string | Postal/ZIP code                    | No       |
| country     | string | Country where the company operates | No       |
| logo        | number | ID of the company logo asset       | No       |

***

### **Example Request**

```json theme={null}
{
  "griddid": "company-slug",
  "mainEmail": "newemail@example.com",
  "mainPhone": "+1234567890",
  "mainContact": "Jane Doe",
  "webURL": "https://www.company.com",
  "address": "456 Elm St",
  "city": "New York",
  "state": "NY",
  "zipCode": "10001",
  "country": "USA",
  "logo": 42
}
```

***

### **Success Response**

#### **200 - OK**

Indicates that the company or user details were successfully updated.

**Example Response:**

```json theme={null}
{
  "success": true,
  "status": 200,
  "message": "Company details updated successfully."
}
```

***

### **Error Responses**

| Status | Description           | Possible Causes                                              |
| ------ | --------------------- | ------------------------------------------------------------ |
| 400    | Bad request           | Invalid or missing fields in the request                     |
| 404    | Not found             | No company or user associated with the provided GNET ID      |
| 422    | Parsing error         | The input data does not meet schema validation rules         |
| 500    | Internal server error | An error occurred on the server while processing the request |

#### **Example Error Response**

```json theme={null}
{
  "success": false,
  "status": 422,
  "error": "Parsing error: Invalid email format."
}
```

***

### **Best Practices**

* **Validate your inputs**: Use the dry run functionality in the [Signup API](/connect-api/sign-up) to confirm the format of inputs before making live updates.
* **Provide only necessary fields**: You do not need to include all fields in the request body—only the ones you want to update.
* **Handle 404 errors gracefully**: If a GNET ID does not exist, suggest checking the ID or creating a new company.

Ready to integrate this endpoint? Check out the [User Check API](/connect-api/user-check) to validate if a user or company exists before editing their details.
